declare @InsertSQL nvarchar(MAX);
set @InsertSQL = N'Insert Into dbo.['+@tableName+N'](ParentID,SourceID,NickName,Content,IP,City,BeFiltered,[Disable])
values (@ParentID,@SourceID,@NickName,@Content,@IP,@City,@BeFiltered,@Disable);select @InsertedID = SCOPE_IDENTITY();';
exec sp_executesql @InsertSQL,
'@ParentID int,@SourceID int,@NickName nvarchar(20),@Content nvarchar(300),@IP nvarchar(30),@City nvarchar(30),@BeFiltered bit,@Disable bit,@InsertedID int output',
@ParentID,
@SourceID,
@NickName,
@Content,
@IP,
@City,
@BeFiltered,
@Disable,
@InsertedID output;
2 回答
慕姐8265434
TA贡献1813条经验 获得超2个赞
declare @InsertSQL nvarchar(MAX); set @InsertSQL = N'Insert Into dbo.['+@tableName+N'](ParentID,SourceID,NickName,Content,IP,City,BeFiltered,[Disable]) values (@ParentID,@SourceID,@NickName,@Content,@IP,@City,@BeFiltered,@Disable);select @InsertedID = SCOPE_IDENTITY();'; exec sp_executesql @InsertSQL, N'@ParentID int,@SourceID int,@NickName nvarchar(20),@Content nvarchar(300),@IP nvarchar(30),@City nvarchar(30),@BeFiltered bit,@Disable bit,@InsertedID int output', @ParentID, @SourceID, @NickName, @Content, @IP, @City, @BeFiltered, @Disable, @InsertedID output;
已经修正错误
- 2 回答
- 0 关注
- 440 浏览
添加回答
举报
0/150
提交
取消