I'm new to Microsoft SQL Server. I have to call an existing procedure and I want to pass the next value of an sequence.
Here a rough overview of my objects and the way I want to pass the values:
I've created an sequence, like
CREATE SEQUENCE mySeq START WITH 10000 CACHE 50;
Also, I created a procedure like
CREATE PROCEDURE P_MY_PROCEDURE
(@V_TECHNICAL_ID BIGINT, @V_VALUE VARCHAR(254))
AS
BEGIN
INSERT INTO mytable (key, value)
VALUES (@v_technical_id, @v_value);
END@
Now, I would like to call the procedure mentioned above the following way:
EXEC P_MY_PROCEDURE NEXT VALUE FOR mySeq, 'Some Value';
While using the previous line, I get the following error:
[Error Code: 102, SQL State: S0001] Incorrect syntax near 'NEXT
What is wrong? With other RDBMS (like Oracle, DB2), the way execution the procedure works without any problems