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? ...

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.