Solved

SQL scripts log

Posted on 2014-04-14
4
143 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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