Hello great Helpers,
written a c# trigger, got it running and it appears to work as expected.
It keeps track of a changelog.
It is allmost written independent of the table for which it has been written.
The only statement that is dependent is the TableName - that should appear in the changelog.
Looking around, I saw code to get that TableName like:
SqlCommand cmd = new SqlCommand("SELECT object_name(resource_associated_entity_id) FROM sys.dm_tran_locks WHERE request_session_id = @@spid and resource_type = 'OBJECT'", conn);
I tried this, but it appears not to work as generic as I would like.
Who has the generic clue ?
Thank you in advance,
Edmond de Savornin Lohman
Utrecht, Netherlands