I posted this with ASP.NET specific tags, but I think that was asking too broad a question, so I'm reposting the SQL part here more specifically. I have two ways of calling a procedure with output using T-SQL. The first is working fine with expected return values:
declare @p5 int
execute dbo.aspCreateQuote @customerID=13,@itemList='text goes here',@quoteID =@p5 output;
select @p5
The second is called using sp_executesql and does not work:
declare @p5 int
set @p5=NULL
exec sp_executesql N'psa.dbo.aspCreateQuote',N'@customerID int,@itemList varchar(1000),@quoteID int output'
,@customerID=13
,@itemList='[xml block of text goes here]',
@quoteID=@p5 output
select @p5
go
It gives the error that the procedure:
expects parameter '@customerID', which was not supplied.
But why would there be any difference between the two calls? The second script is generated by an ASP.NET web app.
Thank you in advance