SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Last Accessed Datetime for table - Easiest way

By Vignesh Arulmani,

This function is used to get the complete table lists are particular table and its last access datetime.

The last access may be the select/insert/update/delete.

After creating the function , try this out...

--complete table list
select * from dbo.fn_get_when_table_lastaccessed('*')
--particular table
select * from dbo.fn_get_when_table_lastaccessed('usermaster')

Regards,

Vignesh Arulmani

Total article views: 3073 | Views in the last 30 days: 2
 
Related Articles
FORUM

Select

Select particular table

FORUM

select statements

select statements

FORUM

select query

select query

FORUM

select count

select count

FORUM

Select query

Select query

Tags
auditing    
 
Contribute