Sunday, March 11, 2012

Auditing SQL Server users

I am trying to create a sql script that will check the database instance for any new objects that are created in any database on my system. These objects I want to audit are users, tables, databases, stored procs, etc.. I also want the script to email me and write the information to a text log file. Thanks in advance for any help.Not sure if that can be achieved. Wh don't you run an audit trace|||That's what Profiler is for. In fact, if properly scripted, it can gather whatever info you want and store it in a database, so you don't need to keep it in a text file. And your email notification can be limited to just something like "A new entry was added to the AUDIT table for USER_CREATE event." You can create a trigger on that AUDIT table and have either SQLMail or CDO/XPSMTP send you this short notice. And then you can decide whether to react upon it or let it go.

No comments:

Post a Comment