I cannot get the InputOutput direction to work for a stored procedure on Azure Sql -
i have created following stored procedure in azure sql.
alter procedure [dbo].[composite_shop_getnextordreno] @orderprefix nvarchar(50) output, @istestmode int = 0 declare @nextordernumber int if not exists (select top 1 [orderprefix] [dbo].[composite_shop_ordernumber] [orderprefix] = @orderprefix) begin insert [dbo].[composite_shop_ordernumber] (orderprefix) values (@orderprefix) end update [dbo].[composite_shop_ordernumber] (readcommittedlock) set @nextordernumber = number = number + 1 [orderprefix] = @orderprefix select @orderprefix = @orderprefix + replicate('0', 6 - len(rtrim(convert(nvarchar(50), @nextordernumber)))) + convert(nvarchar(50), @nextordernumber) return
no matter try c# have not succeeded in giving 1 parameter , getting out again modified.
intutively assume should work don't.
var param = new sqlparameter("@orderprefix",sqldbtype.nvarchar); param.value = "test"; param.direction = parameterdirection.inputoutput; cmd.parameters.add(param);
when check param after been executed same when sending in.
i assume there must have missed.
Comments
Post a Comment