-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code sharing for audit log in single table. #874
Comments
Thanks for sharing @ramveersgh. How do you know which row got deleted (Could field values be saved before deleting the row)? |
@awesomegithubusername I never created any page on wiki but i will try to add it in Wiki if @volkanceylan verify and allow me to add this. |
Thanks for sharing @ramveersgh. Actually yours is similar to AuditLog but i didn't test it for long time. You should share your solution in wiki. Another option is SQL Server Change Data Capture (CDC). |
Thanks @volkanceylan |
Added the Wiki Page for this. |
Good job @ramveersgh. Much appreciated. |
Thanks @awesomegithubusername !! |
great effort But when I apply the code, I see an error in the process of deleting and adding Once again thank you hope for help |
@ramveersgh When this procedure will call ?or from where to call this procedure? |
Hi
I was having a requirement to generate report for work done by user on daily basis and the details of actions (Insert/Update/Delete) by user. Initially i was using ICaptureLogRow but i have so many table and i have to create a copy of each table and a log class for each module. My table also changed frequently so maintaining log table and log class was becoming pain for me. So i created custom behaviour to log all changes in single table.
I am sharing code by thinking that it may be helpful for someone else.
DBScripts for Table, Stored Procedure and Code file is attached.
DB Scripts
SQLServer_AuditScript.txt
Code File
AuditBehavior.txt
How To Use
Ex:
Here is screenshot of log table
Hope this will be helpful for someone. Please let me know if you find any improvement in this or have any suggestions.
The text was updated successfully, but these errors were encountered: