CREATE proc create_erp_table @tabname varchar(255)
as
begin

exec('if object_id('+@tabname+''') is not null drop table '+@tabname+' select * into '+@tabname+' from temp_'+@tabname)
exec('truncate table temp_'+@tabname)
end
GOexec create_erp_table 'product'
到底哪里多了个引号?
为什么老是提示字符串 ') is not null drop table ad_product select * into ad_product from temp_ad_product' 之前有未闭合的引号。
服务器: 消息 170,级别 15,状态 1,行 1
第 1 行: ') is not null drop table ad_product select * into ad_product from temp_ad_product' 附近有语法错误。