Call stored with first out param

Hello,
I have a stored like this:

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

How can I call it for debug purposes?

Thank you.

Luis

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,
@IdUser

You can try this:

 --CREATE PROCEDURE [dbo].[Quotation#Print]
 --@ResultMessage	VARCHAR(MAX) OUT,
 --@IdQuotation	INT,
 --@IdUser
 
 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.

DECLARE @MyOutput  VARCHAR(MAX);

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

PRINT @MyOutput
1 Like

Perfect, thanks a lot Wim.

Luis