Create proc DelRecorder
@tblname varchar(50),
@tblkey int,
@tblwhere int
as
begin
delete @tblname where @tblkey=@tblwhere
end消息 1087,级别 15,状态 2,过程 DelRecorder,第 7 行
必须声明表变量 "@tblname"。
这样创建,为什么会出错
@tblname varchar(50),
@tblkey int,
@tblwhere int
as
begin
delete @tblname where @tblkey=@tblwhere
end消息 1087,级别 15,状态 2,过程 DelRecorder,第 7 行
必须声明表变量 "@tblname"。
这样创建,为什么会出错
exec('delete '+@tblname+' where '+@tblkey+'='+@tblwhere)
end
@tblname varchar(50),
@tblkey int,
@tblwhere int
as
begin
exec('delete '+ @tblname+' where '+ @tblkey+'='+@tblwhere)
end
exec('delete from'+@tblname+' where '+@tblkey+'='+@tblwhere)
end
@tblname varchar(50),
@tblkey int,
@tblwhere int
as
begin
exec('delete '+@tblname+' where '+@tblkey+'='+@tblwhere)
end