How To Find Which Table Record Count Increases Or Decreases In SQL Server

Introduction
 
In this blog, the user can find out in which table records are deleted or inserted from the entire database; also the user can check  in the Excel sheet and found out which table is updated.
 
Write the Query in the SQL in the particular database 
  1. SELECT      T.name TableName,i.Rows NumberOfRows  
  2. FROM        sys.tables T  
  3. JOIN        sys.sysindexes I ON T.OBJECT_ID = I.ID  
  4. WHERE       indid IN (0,1)  
  5. ORDER BY    i.Rows DESC,T.name  
Copy the result data into the Excel sheet like this.
 


Then make your operation. I want to make the operation of insert data into MST_Party_Address, now this table's total records is 554, but after insert operation, this table's total records is 555.  
  1. insert into mst_party_address values('','','','')  
Then execute the same above query from step one.  
  1. SELECT      T.name TableName,i.Rows NumberOfRows  
  2. FROM        sys.tables T  
  3. JOIN        sys.sysindexes I ON T.OBJECT_ID = I.ID  
  4. WHERE       indid IN (0,1)  
  5. ORDER BY    i.Rows DESC,T.name  
  
Copy this data into Excel beside before pasted data.
 
 
 
Here you can see if first pasted data and second pasted data matches the total recorded in this sheet or not.
 
Summary
 
In this blog, you can find out which table data will be inserted  in the entire database.
Ebook Download
View all
Learn
View all