1:
select * from ss1.data1.dbo.test1('P011011085') 应该可以
2:
select * from openquery(ss1,'select * from data1.dbo.test1(''P011011085'')')
select * from ss1.data1.dbo.test1('P011011085') 应该可以
2:
select * from openquery(ss1,'select * from data1.dbo.test1(''P011011085'')')
set @a = 'P011011085'
1:
select * from ss1.data1.dbo.test1(@a) 应该可以
2:
select * from openquery(ss1,'select * from data1.dbo.test1(' + @a + ')')
Line 3: Incorrect syntax near '+'.烦请指教.
set @a = '00000011'
set @sql='select * from openquery(hr,''select * from hr.dbo.EmpList('''''+@a+''''')'')'
print @sql
exec(@sql)