Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Audit Trail

Author  Topic 

ynaina
Starting Member

9 Posts

Posted - 2013-12-22 : 02:52:57
I have a database which is used for a web application(not website).

For each web application user, Is it advisable to create separate db user?

Now I have a single db user to access from the web application. My objective is to have an audit trail for any update or delete. If I am using AFTER DELETE Trigger, I am not able to identify the exact user who is deleting the record.

Please advise me the right way to go ahead.

Thank you in advance.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-22 : 03:11:05
Answered here
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1b00db9d-fd9d-4f92-b899-87b36b04869c/audit-trail?forum=databasedesign

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2013-12-23 : 09:06:03
We store the Update User ID in the record, thus in the trigger we just store the updated/deleted record [in the archive table] - as it already contains the User ID of the person making the update/delete.

Thus we can use a single SQL Login for the application, and have User ID's handled within the application itself.
Go to Top of Page
   

- Advertisement -