Unless you are creating a stored procedure the OUT
clause is being used incorrectly since it is only supported for stored procedures the way you want to use it and in INSERT
, UPDATE
instructions, DELETE
Y MERGE
according to the official documentation: link
What you can do is create the stored procedure:
CREATE PROCEDURE MiProcedimiento
@COD_PERI INT,
@COD_ESTA_LOG INT OUT
AS
BEGIN
SET @COD_ESTA_LOG = 5
END
And send it to call if it is from SQL:
exec MiProcedimiento @COD_PERI, @COD_ESTA_LOG OUTPUT
Or from the programming language in which you are going to use the procedure.