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