|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, December 11, 2012 9:31 AM
Points: 5,
Visits: 77
|
|
OK - I had to create the DBA database - now it seems to be working.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, April 05, 2013 9:32 AM
Points: 42,
Visits: 170
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, September 19, 2012 5:02 PM
Points: 2,
Visits: 49
|
|
Sean, Thankyou, I see it now in the Introduction of the article where is states the database must already exist. It pays to read properly, clearly.
Incidently, this line is not in the doc in the zip file, which is the one I read through after quickly reviewing the article itself.
In any case, it is working for me now.
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, March 22, 2013 3:37 PM
Points: 79,
Visits: 1,317
|
|
Cool stuff, this type of auditing can really come in handy.
However, I am surprised to see @@ERROR\GOTO used as the error handling mechanism in these scripts instead of TRY\CATCH which has been available in 2005 and up (maybe for 6 years now).
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, April 05, 2013 9:32 AM
Points: 42,
Visits: 170
|
|
Have you ever automatically generated the script for a SQL Agent Job in SQL Server Management Studio? When you do this it includes GOTO statements. I've got bigger fish to fry than converting automatically generated scripts!
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, March 22, 2013 3:37 PM
Points: 79,
Visits: 1,317
|
|
Sean Elliott (UK) (8/21/2010)
Have you ever automatically generated the script for a SQL Agent Job in SQL Server Management Studio? When you do this it includes GOTO statements. I've got bigger fish to fry than converting automatically generated scripts! 
Nope, I never have. Well then, if Management Studio generates it, I am once again disappointed with MicroSoft and how they do things.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 5:41 PM
Points: 117,
Visits: 164
|
|
I must say, I'm quite impressed. This appears to be the most complete auditing setup that utilizes DDL triggers. Well done, and thank you for the excellent documentation!
My server's the fastest hunk of junk in the galaxy! -Han SQL Follow on Twitter: @HanSQL
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, April 05, 2013 9:32 AM
Points: 42,
Visits: 170
|
|
Glad you like it. I was quite impressed with myself too
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, April 05, 2013 9:32 AM
Points: 42,
Visits: 170
|
|
| Shortly there will be 2 extra scripts and an associated update to the documentation. These scripts are for uninstalling and re-installing DDL audit capability for one database only. The scripts also disable and re-enable the automatic install of DDL auditing for the server.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 9:22 AM
Points: 5,
Visits: 138
|
|
I have made some modification to your script. To bad but the environment I am in is using database names with spaces in it. This is the reason I had to update your script a little bit. Nothing mayor, but in order to make it work I have added [] around the ? in command to execute sp_MSForEachDB. See the script below. I know it is a bad thing to have a database with spaces in the name, but what can I do if you are getting into a environment without any standards before I came there. 
-- -- SQL 2005 DDL Auditing Solution -- -- Stand up test for all database level auditing and server auditing -- -- Sean Elliott -- sean_p_elliott@yahoo.co.uk -- -- July 2010 --
select * from dbadata..ServerAudit
exec sp_MSForEachDb 'if ''[?]'' != ''[tempdb]'' begin use [?];print ''[?]'';select * from DatabaseAudit end'
exec sp_MSForEachDB 'use [?]; print ''[?]''; create table aa_test_ddl_audit (col1 int)' exec sp_MSForEachDB 'use [?]; print ''[?]''; drop table aa_test_ddl_audit'
|
|
|
|