我编写了以下 SQL 存储过程,它一直在给我错误
@pid = SELECT MAX(...
整个过程是:
Alter PROCEDURE insert_partyco
@pname varchar(200)
AS
BEGIN
DECLARE @pid varchar(200);
@pid = SELECT MAX(party_id)+1 FROM PARTY;
INSERT INTO party(party_id, name) VALUES(@pid, @pname)
SELECT SCOPE_IDENTITY() as PARTY_ID
END
GO
谁能告诉我我在这里做错了什么?