sqlserver存储过程语法错误的问题
CREATE PROCEDURE [ttt] @ta char(20) AS select mem from ' + @ta + ' 总是提示语法错误,请高手帮忙
CREATE PROCEDURE [ttt] @ta char(20) AS select mem from ' + @ta + ' 总是提示语法错误,请高手帮忙
答案:CREATE PROCEDURE [ttt] @ta nvarchar(20) AS
exec('select mem from '+ @ta)
其他:CREATE PROCEDURE [ttt] @ta nvarchar(20) AS
exec('select mem from '+ @ta)
上一个:sqlserver使用 cte 时会将涉及表都锁住吗?求高手解答,本人不懂其中原理望详解
下一个:关于sqlserver触发器的问题