Above the call to this stored procedure is another call to a different stored procedure. The first procedure will assign something to @NewIdentifier
if it needs to, otherwise I need to use the default SaleId
.
exec myStoredProc @SaleId = ISNULL(@NewIdentifier, @SaleId)
It works if I do it this way
declare @Id int
set @Id = ISNULL(@NewIdentifier, @SaleId)
exec myStoredProc @SaleId = @Id
Is it possible to use ISNULL
in the assignment of a stored procedure parameter? I'm not sure what is invalid about this syntax.