请参阅以下脚本,你就知道如何传入参数了
declare @sql nvarchar(4000)
declare @fileInfoE varchar(50)
set @sql ='select * from table where a like @fileInfo';
set @fileInfoE = '%'+@fileInfoE+'%';
exec sp_executesql @sql,N'@fileInfo varchar(50)
',@fileInfo=@fileInfoE
请采纳!
SQL Server数据中运算符与表达式
哪里面?