I blog whenever i find things to remember and which are interesting when i am working/learning. I am happy if these experiences are useful to someone else too :) . Please feel free to suggest/correct. These are just out of my experiences . So they may be always a better way to do them !
I view life as a continuous learning experience !!
Wednesday, November 3, 2010
Query to get retreive a query in a session
DECLARE @sqltext VARBINARY(128)
SELECT @sqltext = sql_handle
FROM sys.sysprocesses
WHERE spid = (sessionid)
print @sqltext
SELECT TEXT
FROM sys.dm_exec_sql_text(@sqltext)
GO
No comments:
Post a Comment