Solved

SQL scripts log

Posted on 2014-04-14
4
141 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
Comment Utility
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 5

Author Comment

by:Sid_F
Comment Utility
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 32

Accepted Solution

by:
Stefan Hoffmann earned 250 total points
Comment Utility
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:ScottPletcher
ScottPletcher earned 250 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
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…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now