Example ตัวอย่างการแสดงค่า PRINT ออกทาง Result และ Message
USE [mydatabase]
GO
/****** Object: StoredProcedure [dbo].[myStoredProcedure] Script Date: 11-Sep-15 3:29:52 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[myStoredProcedure]
@pCountryCode VARCHAR(2),
@pUsed INTEGER
AS
BEGIN
DECLARE @iQueryRowCount INT
SELECT * FROM CUSTOMER WHERE COUNTRY_CODE = @pCountryCode
AND USED >= @pUsed
SET @iQueryRowCount = @@ROWCOUNT
PRINT 'pCountryCode : ' + @pCountryCode
PRINT 'pUsed : ' + CAST(@pUsed AS VARCHAR(10))
PRINT 'Row Count : ' + CAST(@iQueryRowCount AS VARCHAR(10))
END
GO