Simple ASP.NET Code to Find All the SQL Statements Used in a Project


In our project we created plenty of tables and for some reason, some of them are used in our project and some of them are not used. We planned to move the project to the server, but we couldn’t find in one shot what tables exactly were used in the project.

In a normal case we should find them manually one by one by using the find command. It was a very time consuming process. I tried to get some of the tools to find and display the result, but i couldn’t get any so I decided to write this small tool to find them.

Aspx code


Code behind code



Once we click the above button, it will display the path of the file where the file is saved, line no., and the query contains the table name.

Hope it was useful to learn how to get all the tables in one shot. Kindly let me know your thoughts and feedback.


230 total views, 1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *