D dingfuhai Unregistered / Unconfirmed GUEST, unregistred user! 2002-05-31 #1 declare @sql varchar(50), @T table(列定义..) set @sql='select * from @T' exec (@sql) 出错?求解
萧 萧月禾 Unregistered / Unconfirmed GUEST, unregistred user! 2002-05-31 #2 ‘@T’被作为字符串传入,而不是它的值,当然出错了 set @sql='select * from '+ @T
A antic_ant Unregistered / Unconfirmed GUEST, unregistred user! 2002-05-31 #3 我的一个例子 CREATE PROCEDURE del_table ( @tbl_name varchar(20), @where varchar(100) ) AS declare @sql varchar(255) select @sql='delete from '+ @tbl_name + ' where '+@where exec(@sql) RETURN GO
我的一个例子 CREATE PROCEDURE del_table ( @tbl_name varchar(20), @where varchar(100) ) AS declare @sql varchar(255) select @sql='delete from '+ @tbl_name + ' where '+@where exec(@sql) RETURN GO