I am trying to run a sequence from a stored procedure. I am passing the name of the sequence to the stored procedure and the stored procedure will return the sequence value, but the stored procedure is not recognizing the passed sequence name. The error says:
Incorrect syntax near '@SeqName'.
Here's what I have tried:
ALTER PROCEDURE [dbo].[GetSeqNextValue]
(@SeqName varchar(50), @NewNum bigint output)
AS
BEGIN
SET @NewNum = NEXT VALUE FOR @SeqName
END