In Oracle,
We can declare an input-output parameters (not just input or output) like the following:
Create Or Replace Procedure USERTEST.SimpleInOutProcedure(
p_InputInt Int,
p_OutputInt out Int,
p_InputOutputInt in out Int
) AS
BEGIN
p_OutputInt := p_InputInt + 1;
p_InputOutputInt := p_InputOutputInt + p_InputOutputInt;
END;
However, as I try to declare such in SQL Server, the script would not compile:
create procedure SimpleInOutProcedure
@p_InputInt int, @p_OutputInt int input output
As
Begin
Select * from TestTableCommonA;
End
The word "input" is not expected, thus not blue-colored in the SQL Server Management Studio:
What's wrong with my script, how to declare input-output parameters in SQL Server Stored Procedure/Function?
I want to do this because I need to create "equivalent" reader for SQL Server DB which previously was created for Oracle DB and has the reader for in/out parameters.