Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to figure out how many tables are affected in database after inserting a record?

One third party app is storing data in a huge database (SQL Server 2000/2005). This database has more than 80 tables. How would I come to know that how many tables are affected when application stores a new record in database? Is there something available I can retrieve the list of tables affected?

like image 937
Jango Avatar asked Nov 15 '25 18:11

Jango


2 Answers

You might be able to tell by running a trace in SQL Profiler on the database - the SQL:StmtCompleted event is probably the one to monitor - i.e. if the application does a series of inserts into multiple tables, you should see them go through in Profiler.

like image 189
AdaTheDev Avatar answered Nov 17 '25 07:11

AdaTheDev


You can use SQL Profiler to trace SQL queries. So you will see sequence of calls caused by one button click in your application.

Also use can use metadata or SQL tools to get list of triggers which could make a lot of actions on simple insert.

like image 35
burnall Avatar answered Nov 17 '25 07:11

burnall



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!