Tuesday, February 14, 2012

Command to display SQL Statements

Does anyone know the command to display the whole SQL statement for a
connection after apply sp3?
Thanks,
LijunTake a look at the fn_get_sql topic in books online, assuming you updated...
"Lijun Zhang" <nospam@.nospam.nospam> wrote in message
news:#UPomeMnDHA.2592@.TK2MSFTNGP10.phx.gbl...
> Does anyone know the command to display the whole SQL statement for a
> connection after apply sp3?
> Thanks,
> Lijun
>|||Hi Lijun,
I agree with Aaron, you can use the fn_get_sql function to retrieve the SQL handle (sql_handle
column of the sysprocesses) and help you diagnose problematic processes.
You can also use "DBCC INPUTBUFFER" to easily display the LAST statement sent from a
client. The system process ID (SPID) for the user connection can be displayed in the output of
the sp_who system stored procedure.
Does that answer your question? Please feel free to post in the group if this solves your
problem or if you would like further assistance.
Best regards,
Billy Yao
Microsoft Online Partner Support

No comments:

Post a Comment