haitao:
把表变量传给字符串sql使用也不行。。。。。。。
[阅读: 700] 2007-08-16 07:29:09
declare @tb2 table(fid int IDENTITY,fname varchar(50),fdatetime datetime)
declare @sql nvarchar(4000)
set @sql='select * from @tb'
exec sp_executesql @sql, N'@tb table(fid int IDENTITY,fname varchar(50),fdatetime datetime) input output',@tb=@tb2
——报语法错:要求定义@tb2,而@tb2明明是被定义为一个表变量的!可能它要求一个简单类型的参数。。。。。。