Tuesday, August 6, 2013

SQL SERVER – Find Currently Running Query – T-SQL

declare
    @spid int, 
    @sql_handle binary(20)

set @spid =64 -- Fill this  with spid

select  top 1
    @sql_handle = sql_handle

from    master.dbo.sysprocesses
where   spid = @spid
order by ecid

SELECT
   *
FROM ::fn_get_sql(@sql_handle)



If you are searching life partner. your searching end with kpmarriage.com. now kpmarriage.com offer free matrimonial website which offer free message, free chat, free view contact information. so register here : kpmarriage.com- Free matrimonial website

Related Posts:

  • SQL WHERE ClauseThe WHERE clause is used to filter records. The WHERE clause is used to extract only those records that fulfill a specified criterion. SQL WHERE Syn… Read More
  • SQL ORDER BY KeywordThe ORDER BY KeywordThe ORDER BY keyword is used to sort the result-set by a specified column.The ORDER BY keyword sort the records in ascending order… Read More
  • SQL SELECT INTO StatementThe SQL SELECT INTO statement can be used to create backup copies of tables. The SQL SELECT INTO StatementThe SELECT INTO statement selects data from … Read More
  • HTML HeadingsHTML headings are defined with the to tags. Example <h1> This is a heading</h1> <h2> This is a heading</h2> <h3> This is … Read More
  • SQL AND & OR OperatorsThe AND & OR operators are used to filter records based on more than one condition. The AND & OR OperatorsThe AND operator displays a record… Read More

0 comments:

Post a Comment