insert into #t exec [acwh].dbo.[ud_GetStore] '2014-05-01','2014-08-01'这样可以运行,但是由于 数据库(acwh)名字是参数,我想把它整个拼接成字符串,要怎么做
declare @sqlText varchar(max)set @sqlText=''@sqlText='insert into #t;exec'+@acwh+'dbo.[ud_GetStore]''+...@axwh就是你的参数 你事先定义一下就好