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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Logging SQL that has run

Author  Topic 

powellbound
Starting Member

23 Posts

Posted - 2009-03-17 : 11:59:30
Does SQLServer (2005 in this case) log the SQL that is submitted to the db anyplace or can I change a setting to log the SQL? We are seeing the server simply lock up and we are thinking it might be some offending SQL.

Thanks

mfemenel
Professor Frink

1421 Posts

Posted - 2009-03-17 : 13:06:13
Try this:
select * from sys.dm_exec_sql_text
If that doesn't provide enough information for you then I would suggest a trace or profiler.

Mike
"oh, that monkey is going to pay"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-17 : 13:16:20
what does sp_who2 show ?
Go to Top of Page

powellbound
Starting Member

23 Posts

Posted - 2009-03-18 : 09:34:07
When I run this: select * from sys.dm_exec_sql_text

I get this:

Msg 216, Level 16, State 1, Line 1
Parameters were not supplied for the function 'sys.dm_exec_sql_text'.
Go to Top of Page
   

- Advertisement -