Call stored with first out param

I have a stored like this:

ALTER PROCEDURE [dbo].[Quotation#Print]
@ResultMessage VARCHAR(MAX) OUT,
@IdQuotation INT,

How can I call it for debug purposes?

Thank you.


I'm not really sure if I understand you.

If you want to debug a Stored Procedure with the interface

PROCEDURE [dbo].[Quotation#Print]
@ResultMessage	VARCHAR(MAX) OUT,
@IdQuotation	INT,

You can try this:

 --CREATE PROCEDURE [dbo].[Quotation#Print]
 --@ResultMessage	VARCHAR(MAX) OUT,
 --@IdQuotation	INT,
 DECLARE @ResultMessage	VARCHAR(MAX) = 'Your debug data'
 DECLARE @IdQuotation	INT = 0	--  more debug data
 DECLARE @IdUser  INT = 12	--more debug data

And run the SQL code of the body of the SP in an interactive way from SSMS.

Yes, I'd need just the correct EXEC statement for this kind of procedure.


EXECUTE dbo.[Quotation#Print] 
		@ResultMessage = @MyOutput OUTPUT
		, @IdQuotation = 10
		, @IdUser = 12

PRINT @MyOutput
1 Like

Perfect, thanks a lot Wim.