How to find the date and time of last updated table?

Answers were Sorted based on User's Feedback



How to find the date and time of last updated table? ..

Answer / monal

USE TRIGGER OR ADD DATETIMESTAMP COLUMN IN A TABLE WITH
DEFAULT VALUE OF GETDATE()

Is This Answer Correct ?    9 Yes 2 No

How to find the date and time of last updated table? ..

Answer / sanjeev kumar

SELECT OBJECT_NAME(OBJECT_ID) AS tablename,
last_user_update
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'your_database_name')
and user_updates>0
order by last_user_seek desc

Is This Answer Correct ?    3 Yes 0 No

How to find the date and time of last updated table? ..

Answer / smitha

select name,create_date,modify_date from sys.tables
order by modify_date desc

Is This Answer Correct ?    5 Yes 3 No

How to find the date and time of last updated table? ..

Answer / vidit tyagi

SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName,
last_user_update,*
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'DataBaseName')
AND OBJECT_ID=OBJECT_ID('TableName')

Is This Answer Correct ?    1 Yes 0 No

How to find the date and time of last updated table? ..

Answer / ram

USE TRIGGER OR ADD DATETIMESTAMP COLUMN IN A TABLE WITH
DEFAULT VALUE OF GETDATE()

Is This Answer Correct ?    1 Yes 1 No

How to find the date and time of last updated table? ..

Answer / siddharthapenchala

select scn_to_timestamp(max(ora_rowscn)) from <TN>

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What is the appropriate number of test cases that you can write on a database?

2 Answers   Microsoft,


do views contain data ?

0 Answers   MCN Solutions,


How to write a query with an inner join in ms sql server?

0 Answers  


Write a SQL command to insert and update only a particular field?

0 Answers   ADITI,


What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas

0 Answers  






What is 3nf normalization?

0 Answers  


What is a partition function in sql server?

0 Answers  


What is an extended Stored Procedure?

1 Answers  


if we have a column (Key) in a table. and values of that column is Key 1 1 1 2 2 3 3 4 4 5 5 5 and we want to show the data after query..like.. 1(3) 2(3) 3(2) 4(2) 5(3) how many times a single term comes..

17 Answers   3i Infotech, Rolta, TCS,


What is normalization according to you and explain its different levels?

0 Answers  


How to verify a user name with sqlcmd tool?

0 Answers  


How many types of cursors are there in SQL Server?

5 Answers   247Customer, CarrizalSoft Technologies,


Categories