我收到此错误:
Msg 102,Level 15,State 1,Line 9'+'附近的语法不正确。
执行以下代码时:
DECLARE @Source nVARCHAR(30)
set @source = 'Srce.srce'
select @Source
--drop table #temp1
select 'xx' col1
INTO #temp
from @Source + .dbo.table1
答案 0 :(得分:0)
您无法通过变量传递数据库的名称。 如果要使用变量转发数据库的名称,则必须使用动态SQL。