-- Declare
Declare a variable using the declare statement in the body of a batch or process and assign a value to it using the set or select statement. The cursor variable can be declared through this statement and can be used in other statements related to the cursor. All variables are initialized to null after declaration.
-- Print
The print statement uses a single character or Unicode string expression as a parameter. It returns this string as a message to the application. The message is returned as a message error in ADO, ole db, and ODBC applications. Sqlstate is set to 01000, the local error is set to 0, and the error message string is set to the string specified in the print statement. The string is returned to the message handler callback function of the DB-library application.
The print statement accepts any string expression, including a character or Unicode constant, character or Unicode local variable name, or a function that returns a character or Unicode string. In Microsoft & reg; SQL Server & Trade 2000, print also accepts complex strings generated by concatenating two or more constants, local variables, or functions.
Print helps us discover and solve problems in the transact-SQL code, check data values, or generate reports.
TIPS:
This page (http://www.cnblogs.com/qiantuwuliang/archive/2009/07/19/1526408.html) when the instance used print, can play a "Debug SQL" role !!!