Explanations:
Your statement syntax is for PL/SQL (Oracle). Error message is from MS SQL Server. If you want to translate this statement into T-SQL (MS SQL Server), you must use this (SECURITY
must be your schema name or use dbo
as schema name):
CREATE PROCEDURE [SECURITY].[UPDATE_REFS_P]
@pIdProcessExec bigint,
@pProcessDate date,
@pDebugMode integer = 0,
@pCallingInterface varchar(200) = 'Manual',
@pCheckResult integer OUTPUT
AS
BEGIN
...
END
and
ALTER PROCEDURE [SECURITY].[UPDATE_REFS_P]
@pIdProcessExec bigint,
@pProcessDate date,
@pDebugMode integer = 0,
@pCallingInterface varchar(200) = 'Manual',
@pCheckResult integer OUTPUT
AS
BEGIN
...
END
Extended syntax OR ALTER applies to Azure SQL Database and SQL Server (starting with SQL Server 2016 (13.x) SP1).
Working example:
CREATE PROCEDURE [dbo].[UPDATE_REFS_P]
@pIdProcessExec bigint,
@pProcessDate date,
@pDebugMode integer = 0,
@pCallingInterface varchar(200) = 'Manual',
@pCheckResult integer OUTPUT
AS
BEGIN
-- Default value as resultset
SELECT @pCallingInterface AS [TEXT]
-- Output parameter value
SELECT @pCheckResult = 123
--
RETURN 0
END
CREATE OR ALTER
, however, as @AlexK. has pointed out, the rest is still not SQL Server either. SQL Server uses brackets ([]
) for quoting objects, not double quotes ("
), and variables/parameters start with an at symbol (@
) and don't being the declaration within
. I have no idea what language that is meant to be. – Larnu