尝试将已声明的变量Ids插入另一个表时收到错误消息。我该如何纠正?
ALTER PROCEDURE [dbo].[tbl_Update]
@id int,
@description nvarchar(50),
@price decimal(12,7),
@statusId int,
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Update tbl
set
description=@description,
price=@price,
statusId=@statusId
where id = @id
--Once submitted values will map to adminEdm
if (@statusId = 1)
--Every subform will be created and their ids will be
Declare @generalId table (id int)
insert into tblGeneral
output inserted.id into @generalId(id)
default values
Declare @categoryId table (id int)
insert into tblCategory
output inserted.id into @categoryId(id)
default values
--ERROR when inserting
Insert into tblParent(generalId, categoryId)
values(Select id from @generalId, Select id from @categoryId)
END
错误消息“关键字'选择'附近的语法不正确”