Q&A

Q1:What is the difference between the RAISERROR and PRINT statements?
A1: When using the RAISERROR statement, you must use a severity code of 0 if you do not want the procedure to terminate early. When using a severity code of 0, the RAISERROR statement behaves much like the PRINT statement. But the real difference between these two statements is that the PRINT statement enables you to display many of the system variables and functions.
Q2:Can I use the T-SQL debugger to test a function?
A2: No. The T-SQL debugger can be used to test and debug only a stored procedure.
Q3:I have used PRINT statements to display information about the procedure that I am testing. However, the output I am looking for takes a long time to print. What is wrong?
A3: There is nothing wrong. Remember that the server batches output together in packets of 512 bytes. The server will not send a packet until it is full, unless the procedure has completed.
Q4:How can I execute a portion of a procedure instead of the entire procedure?
A4: In the Query Analyzer, you can execute a portion of any procedure (function, trigger, or stored procedure) while testing it by selecting the portion you want to execute and then pressing the F5 key or clicking the Run button.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset