私のストアドプロシージャは次のように定義されています
create procedure p1
(
@id INT,
@name varchar(20) OUTPUT,
@company varchar(20) OUTPUT
)
AS
BEGIN
select @name = name, @company = company from table1 where id = @id;
END
GO
私はそれを使用して呼び出します
DECLARE @name varchar(20), @company varchar(20), @id INT;
exec dbo.p1 @id=2, @name OUTPUT, @company OUTPUT;
select @name AS 'NAME', @company AS 'COMPANY'
ただし、エラーが発生します
'Must pass parameter number 2 and subsequent parameters as '@name = value'. After the form '@name = value' has been used, all subsequent parameters must be passed in the form '@name = value'.