Hi 65877627,
Can you try with that?
Oracle Procedure:
CREATE OR REPLACE
PROCEDURE getSequenceValue
(
SeqName VARCHAR2,
nValue IN OUT Number
)
AS
BEGIN
EXECUTE IMMEDIATE 'SELECT ' || SeqName || '.NEXTVAL FROM DUAL'
INTO nValue;
END;
SQL Server 2016 Procedure:
CREATE PROCEDURE GETSEQUENCEVALUE
(
@SEQNAME varchar(max),
@NVALUE float(53) OUTPUT
)
AS
BEGIN
-- SSMA warning: Conversion from NUMBER datatype can cause data loss.
-- SSMA error: EXECUTE IMMEDIATE statement was converted into EXEC(...) statement, but dynamic string was not converted. It must be converted manually.
DECLARE @sqlText nvarchar(max);
SET @sqlText = N'SELECT ' + @SEQNAME + '.NEXTVAL FROM DUAL';
EXEC sp_executesql @sqlText, N'@SEQNAME varchar(max)', @SEQNAME, @NVALUE OUTPUT;
END;
Regards,