EXEC sp_executesql

Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar',

 

出现这个提示,是因为变量@sql的类型有误,声明时应该写成nvarchar,如:
declare @sql nvarchar(50)

 

 Must declare the scalar variable

EXEC sp_executesql

 

EXEC

 

sp_executesql @querysql,N'@A INT,@B INT,@C INT,@totalrowcounts INT OUTPUT',@A,@B,@C,@totalrowcounts OUTPUT

你可能感兴趣的:(EXEC sp_executesql)