TSQL,我这个SQL 总报错 过程需要类型为 'ntext/nchar/nvarchar' 的参数 '@parameters
declare@InsertSQLnvarchar(MAX);set@InsertSQL=N'InsertIntodbo.['+@tableName+N'](Parent...
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; 展开
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; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询