MSSQLWIKI

Karthick P.K on SQL Server

How to get SQL Text and Query Plan for statements which are executing now

Posted by Karthick P.K on February 1, 2010

 SELECT getdate() as "RunTime", st.text, qp.query_plan, a.* FROM sys.dm_exec_requests a CROSS APPLY sys.dm_exec_sql_text(a.sql_handle) as st CROSS APPLY sys.dm_exec_query_plan(a.plan_handle) as qp order by CPU_time desc  

 

If you liked this post, do like us on Facebook at https://www.facebook.com/mssqlwiki and join our Facebook group https://www.facebook.com/mssqlwiki#!/groups/454762937884205/

Thank you,

Karthick P.K |My Facebook Page |My Site| Blog space| Twitter

About these ads

5 Responses to “How to get SQL Text and Query Plan for statements which are executing now”

  1. Hey there are using WordPress for your blog platform?

    I’m new to the blog world but I’m trying to get started and set up my own.
    Do you need any html coding expertise to make your own blog?
    Any help would be really appreciated!

  2. Excellent happy synthetic eyesight just for fine detail and can foresee issues prior to they will happen.

  3. Mix – Zing is available in a free version that includes ads and a
    pay version that makes the lock-screen widget available.
    MP3tunes Locker, MP3 Music Download Advance, Music Box, and Music Junk are four more music apps designed for Android.

    This is typical of positions that have a lot of flaws in pawn structure, which
    is why you should avoid having these weaknesses in your own games.

  4. […] How to get SQL Text and Query Plan for statements which are executing now […]

  5. If your preferred fruit isn’t in season, use a package of frozen fruit with its syrup.
    Ways to attain the best advantages from
    your healthy and balanced smoothie recipes is always to look at the proper mix
    of fruit and veggies. cup frozen strawberries, and one scoop vanilla
    protein powder in a blender and blend until smooth and
    frosty.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 2,105 other followers

%d bloggers like this: