SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Get History of Executed Commands
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

lesponce
Starting Member

8 Posts

Posted - 07/12/2013 :  12:53:21  Show Profile  Reply with Quote
How do I get a history of executed T-SQL Commands? I need run an audit for the last 3 months by Login Name. Using SQL, instead of products like Idera.

Also, how can I do that if the audit that I'm doing is for a linked server. Using the select openquery command?

James K
Flowing Fount of Yak Knowledge

3741 Posts

Posted - 07/12/2013 :  14:34:55  Show Profile  Reply with Quote
Unless you have trace or CDC or something like that enabled, SQL Server does not keep a history of all the queries run against the server.
Go to Top of Page

lesponce
Starting Member

8 Posts

Posted - 07/12/2013 :  14:58:49  Show Profile  Reply with Quote
Thanks James.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 07/13/2013 :  12:14:25  Show Profile  Reply with Quote
another way is to use profiler traces.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3741 Posts

Posted - 07/13/2013 :  17:49:05  Show Profile  Reply with Quote
You are very welcome.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000