Click here to Skip to main content
15,908,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Example is:-
I have a registration form when i insert a value through it 5 tables are effected .I want to find a general sql query which on run give the tables name last inserted or updated through a vb.net for.

Note:
No forign key concept usage
Posted
Comments
ExcelledProducts 6-Nov-12 14:44pm    
please post the question in the question box and not the subject box :\
bbirajdar 7-Nov-12 22:55pm    
You will get the names of the tables inserted in the insert query itself.... :)

Try:
SQL
SELECT OBJECT_NAME(OBJECT_ID) as TableName,last_user_update FROM sys.dm_db_index_usage_stats where sys.dm_db_index_usage_stats.database_id = DB_ID( 'TEAM1') order by last_user_update desc
 
Share this answer
 
v3
Comments
Shanalal Kasim 8-Nov-12 6:57am    
If it helped you to solve your problem , mark it as answer
VB
Error <pre lang="xml">ig><b>[Microsoft][ODBC SQL SERVER DRIVER][SQL SERVER]Invalid object name ‘sys.dm_db_index_usage_stats’</b></big>>
Occur</pre>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900