Solved

SQL scripts log

Posted on 2014-04-14
4
145 Views
Last Modified: 2014-05-06
Is it possible to check if scripts have been run against a 2008 SQL database.
0
Comment
Question by:Sid_F
4 Comments
 
LVL 16

Expert Comment

by:Wasim Akram Shaik
ID: 39998485
If an audit is created and enabled, you can read it though.

You can read the Windows event logs by using the Event Viewer utility in Windows. For file targets, you can use either the Log File Viewer in SQL Server Management Studio or the fn_get_audit_file function to read the target file.

read this to find out more


http://technet.microsoft.com/en-us/library/dd392015%28v=sql.100%29.aspx

http://technet.microsoft.com/en-us/library/cc280386.aspx
0
 
LVL 6

Author Comment

by:Sid_F
ID: 39998585
Event viewer is vague. Can I specifically view if a script has been run against a database if the database has been setup with default options. I'm not sure if audit is default?
0
 
LVL 33

Accepted Solution

by:
ste5an earned 250 total points
ID: 39998792
Please define 'script'..

But I would guess that you should take a look at server-side traces: Introducing SQL Trace.

Or a slightliy better overview (SQL Server 2005, but applies also to 2008): Server-Side Tracing and Collection.
0
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 250 total points
ID: 39999626
No.  There is a default trace (unless you explicitly disabled it) but it is pretty lightweight.

When you think of the enormous overhead to create a record of all scripts run(!), you can see why SQL doesn't do that.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question