sp_blocker_pss80

  • Hi All

     

    I am running sp_blocker_pss80 SP to get the block details, but I could't able to get the FULL SQL in the output. DBCC inputbuffer truncates the SQL. so can you guys tell me how can I get the full SQL statement using this SP?

     

    Thanks in advance

    regards

    Santhosh

  • You could use fn_get_sql. This way the statement won't be truncated.

    DECLARE @handle binary(20)

    SELECT @handle = sql_handle

        FROM master..sysprocesses

        WHERE spid = @@SPID

    SELECT [text]

        FROM ::fn_get_sql(@handle)

     

    Markus

    [font="Verdana"]Markus Bohse[/font]

  • Hi

    Thanks for the reply...

    Where should I add this inside the MS supplied sp_blocker_pss80

    procedure?

     

    regards

    Santhosh

  • To be honest, I haven't had alook at sp_blocker_pss80 and who to integrate fn_get_sql_handle but maybe you can find some ideas in this article. http://vyaskn.tripod.com/fn_get_sql.htm

    Markus

    [font="Verdana"]Markus Bohse[/font]

  • Hi

     

    Where can I see this fn_get_sql SP? Can I have the source code for this?

    Regards

    Santhosh

    ========================

    DECLARE @handle binary(20)

    SELECT @handle = sql_handle

        FROM master..sysprocesses

        WHERE spid = @@SPID

    SELECT [text]

        FROM ::fn_get_sql(@handle)

  • Santhosh,

    Exec sp_helptext 'sys.fn_get_sql'  will give you the code for this function, but I don't understand why you would need that.

    Markus

    [font="Verdana"]Markus Bohse[/font]

Viewing 6 posts - 1 through 5 (of 5 total)

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