Nó không hỗ trợ màn hình hiển thị resultsets. Trong các phiên bản cũ, nó đã không thể nối một chuỗi bên trong một tuyên bố Print. Một số tiện ích xử lý tin nhắn từ câu lệnh in khác nhau hơn là tập kết quả từ câu lệnh Select. | 287 Chapter 7 Debugging and Error Handling one additional parameter with the default set to 0 to the stored procedure. debug int 0 In the stored procedure at all important points I add code that tests the value of the debug variable and displays the values of selected variables or resultsets if debug 0 select chvProperty Property chvValue Value chvUnit Unit if debug 0 select from Properties I do not use the Print statement for this purpose because It does not support the display of resultsets. In older versions it was impossible to concatenate a string inside a Print statement. Some utilities handle messages from the Print statement differently than they do the resultset from the Select statement. In the following example you can see a stored procedure that is designed to support this kind of testing Alter Procedure prGetInventoryProperties_2 -- Return comma-delimited list of properties -- which are describing asset. -- . Property Value unit Property Value unit . intInventoryld int chvProperties varchar 8000 OUTPUT debug int 0 As 288 SQL Server 2000 Stored Procedure Programming set nocount on declare intCountProperties int @intCounter int chvProperty varchar 50 @chvValue varchar 50 chvUnit varchar 50 @insLenProperty smallint @insLenValue smallint @insLenUnit smallint @insLenProperties smallint declare chvProcedure sysname set chvProcedure prGetInventoryProperties_2 if debug 0 select chvProcedure START Create table Properties Id int identity 1 1 Property varchar 50 Value varchar 50 Unit varchar 50 -- identify Properties associated with asset insert into Properties Property Value Unit select Property Value Unit from InventoryProperty inner join Property on where intInventoryId if debug 0 select from Properties -- set loop select intCountProperties Count intCounter 1 289 Chapter 7 Debugging and Error Handling @chvProperties from Properties -- loop through list of properties while .