Who did what?

  • mobasha

    SSCertifiable

    Points: 5334

    Comments posted to this topic are about the item Who did what?

    ..>>..

    MobashA

  • RBarryYoung

    SSC Guru

    Points: 143327

    Nice. I will keep this one.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • mobasha

    SSCertifiable

    Points: 5334

    thanks.

    do any one have a solution if i need to run this select every 2 seconds?

    i have been trying but am stuck in a dead end.

    ..>>..

    MobashA

  • TimothyAWiseman

    SSCrazy Eights

    Points: 8819

    After playing with it a little this is definitely a useful query, but the article could certainly go with more explanation about what its intent is and how it functions. That would make it a bit easier to understand.

    ---
    Timothy A Wiseman
    SQL Blog: http://timothyawiseman.wordpress.com/

  • RBarryYoung

    SSC Guru

    Points: 143327

    Probably should be listed under "Scripts" instead of "Articles".

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • RBarryYoung

    SSC Guru

    Points: 143327

    mobasha (3/11/2008)


    thanks.

    do any one have a solution if i need to run this select every 2 seconds?

    i have been trying but am stuck in a dead end.

    Well, this does what you asked for, but probably is not what you want:

    While (1=1)

    BEGIN

    Waitfor Delay '00:00:02'

    {your query's}

    END

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • RBarryYoung

    SSC Guru

    Points: 143327

    I don't know any tricks to get periodic query refreshing inside SSMS, I always write a VB.net client to do this kind of stuff.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • mobasha

    SSCertifiable

    Points: 5334

    thanks all.

    ur solution were v.smart.

    thanks a lot for the help.

    ..>>..

    MobashA

  • Dugi

    SSCoach

    Points: 17998

    very nice script...thnx!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • RBarryYoung

    SSC Guru

    Points: 143327

    MobashA, you're welcome.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • TaoCanis

    Old Hand

    Points: 332

    Hi,

    Is this script for 2005 only or does it work for 2000? Thanks.

  • CJensen-489142

    SSC Rookie

    Points: 40

    Looks like good info to have. . ., but my SSMS query keeps rejecting the code. It complains about the three inline queries for the elements from dm_exec_sql_text function, doesn't like the '.' within the function argument. Is this a database compatibility issue?

    Any ideas?:)

  • keliu

    SSC Rookie

    Points: 37

    I like to know when who is doing in the query.

    Can anybody help?

    Thanks.

    Ke

  • Chadwick-788357

    Old Hand

    Points: 394

    Very helpful script. Thanks. I changed it a bit to make the code cleaner. This produces the same result:

    USE MASTER

    SELECT

    s.session_id, s.host_name, s.program_name, s.client_interface_name, s.login_name

    ,s.nt_domain, s.nt_user_name, c.client_net_address, c.local_net_address

    --,c.connection_id,c.parent_connection_id, c.most_recent_sql_handle

    ,(SELECT text FROM sys.dm_exec_sql_text(c.most_recent_sql_handle)) as sqlscript

    ,(SELECT db_name(dbid) FROM sys.dm_exec_sql_text(c.most_recent_sql_handle)) as databasename

    ,(SELECT object_id(objectid) FROM sys.dm_exec_sql_text(c.most_recent_sql_handle)) as objectname

    FROM

    sys.dm_exec_sessions as s

    INNER JOIN

    sys.dm_exec_connections as c

    ON c.session_id = s.session_id

  • logicinside22

    SSCrazy Eights

    Points: 9617

    nice script ...amazing result which i want to see it.

    thanks

    Aim to inspire rather than to teach.
    SQL Server DBA

Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic. Login to reply