Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL scripts log

Posted on 2014-04-14
4
Medium Priority
?
151 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 36

Accepted Solution

by:
ste5an earned 1000 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 70

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 1000 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

963 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