我有存储过程。代码如下:
use nisa1415;
go
alter procedure dep.AddLessons
(
@LessonsTable nvarchar(50),
@LesDepId int,
@TeId int,
@GradeId varchar(10),
@Activated int,
@GroupId int,
@TaskTable nvarchar(50)
)
as
begin select @LessonsTable=
case @LessonsTable when 'dep.les_Biology' then
insert into dep.les_Biology(LesDepId,TeId,GradeId,Activated,GroupId,TaskTable)
values(@LesDepId,@TeId,@GradeId,@Activated,@GroupId,@TaskTable) end
return
end
它给我一个错误:'insert'附近的语法不正确 什么是我找不到的问题?
答案 0 :(得分:1)
ALTER procedure AddLessons
(
@LessonsTable nvarchar(50),
@LesDepId int,
@TeId int,
@GradeId varchar(10),
@Activated int,
@GroupId int,
@TaskTable nvarchar(50)
)
as
begin
if @LessonsTable = 'dep.les_Biology'
begin
insert into dep.les_Biology(LesDepId,TeId,GradeId,Activated,GroupId,TaskTable)
values(@LesDepId,@TeId,@GradeId,@Activated,@GroupId,@TaskTable) end
return
end