Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | lesponceStarting Member
 
 
                                        8 Posts | 
                                            
                                            |  Posted - 2013-07-12 : 12:53:21 
 |  
                                            | 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 KMaster Smack Fu Yak Hacker
 
 
                                    3873 Posts | 
                                        
                                          |  Posted - 2013-07-12 : 14:34:55 
 |  
                                          | 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. |  
                                          |  |  |  
                                    | lesponceStarting Member
 
 
                                    8 Posts | 
                                        
                                          |  Posted - 2013-07-12 : 14:58:49 
 |  
                                          | Thanks James. |  
                                          |  |  |  
                                    | visakh16Very Important crosS Applying yaK Herder
 
 
                                    52326 Posts | 
                                        
                                          |  Posted - 2013-07-13 : 12:14:25 
 |  
                                          | another way is to use profiler traces.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |  
                                          |  |  |  
                                    | James KMaster Smack Fu Yak Hacker
 
 
                                    3873 Posts | 
                                        
                                          |  Posted - 2013-07-13 : 17:49:05 
 |  
                                          | You are very welcome. |  
                                          |  |  |  
                                |  |  |  |