how to debug stored procedures using SQL 2000

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sanika1507
    New Member
    • Sep 2007
    • 34

    how to debug stored procedures using SQL 2000

    hi all,

    how to debug a stored procedure ..

    Actually what i did was split the stored procs and took and SQL query and executed it...

    but i dont knw how to print the values of these stored procs like for ex the below is th epart of the stored proc

    If @ProcessId = 2
    BEGIN
    Update Vendors
    Set ProcessId = 2
    where Num = @Num
    and RevNum <= @RevNum
    and Code = @Code
    and Error_Message = isnull(@error_M essage,Error_Me ssage)
    --RETURN
    END

    Actaully i am not able to understand the line
    Error_Message = isnull(@error_M essage,Error_Me ssage)

    and like why it has cme with the where clause ...

    when i try to print the value of error_message , it says to declare it first .After declaring also it still gives an error.
    Can you please tell me how to go about and understand the logic of the entire stored proc one by one ....

    thanks and Regards
    Sanika
  • davef
    New Member
    • Sep 2007
    • 98

    #2
    Originally posted by sanika1507
    hi all,

    how to debug a stored procedure ..

    Actually what i did was split the stored procs and took and SQL query and executed it...

    but i dont knw how to print the values of these stored procs like for ex the below is th epart of the stored proc

    If @ProcessId = 2
    BEGIN
    Update Vendors
    Set ProcessId = 2
    where Num = @Num
    and RevNum <= @RevNum
    and Code = @Code
    and Error_Message = isnull(@error_M essage,Error_Me ssage)
    --RETURN
    END

    Actaully i am not able to understand the line
    Error_Message = isnull(@error_M essage,Error_Me ssage)

    and like why it has cme with the where clause ...

    when i try to print the value of error_message , it says to declare it first .After declaring also it still gives an error.
    Can you please tell me how to go about and understand the logic of the entire stored proc one by one ....

    thanks and Regards
    Sanika
    Script the sp and post the code. Also, show how you invoke it.

    Comment

    Working...