Browse by Tags

TSQL to get current executing statements - SQL Server 2005
Published 12 February 8 2:27 PM | SSQA.net
Using SP_WHO or SP_WHO2 is a common way to get list of executing processes currently on the server, within SQL Server 2005 you could take advantage of DMV that lists currently-executing statements. select r.session_id ,status ,substring(qt.text,r.statement_start_offset...
Show text from sql_handle
Published 4 October 7 5:50 AM | SSQA.net
Based upon the query or stored procedure execution the plan will be stored in the cache, but it may not be in readable format as it is stored in Hexadecimal when you simply query SYSPROCESSES table. So in order to extract the query plan that is in cache...
TSQL to list the most used query plans
Published 28 September 7 3:12 AM | SSQA.net
select TOP 100 objtype, p.size_in_bytes, LEFT([sql].[text], 100) as [text] from sys.dm_exec_cached_plans p outer apply sys.dm_exec_sql_text (p.plan_handle) sql ORDER BY usecounts DESC...( read more ) Read More...
Executing a batch multiple times with a single word - Awesome hint from SQL Server Goddess
Published 5 September 7 4:42 AM | SSQA.net
What can I say, excellent hint from SQL Server Goddess aka 'Kalen Delaney' to achieve an execution of a batch multiple times with a simple 1 word statement. I feel I was late to find this tip and to share the same within my community here it is...