I receive this error when running this script (tablenames have been changed to protect the innocent)
declare @dbname varchar(50)
declare @id varchar(10)
set @dbname = 'database1'
set @id = '1001'
declare @sql nvarchar(3000)
set @sql = 'select top 5 table1.id, value
from server.'+@dbname+'.dbo.table1 table1,
server.'+@dbname+'.dbo.table2 table2
where table2.id = table1.otherid
and table1.id = '+@id+' '
exec sp_sqlexec @sql
I'm receiving this error:
Server: Msg 7405, Level 16, State 1, Line 1
Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.
After throwing in
set ansi_nulls on
go
set ansi_warnings on
go
or variations thereof before the script, the same error is still being returned. Any ideas, folks?
declare @dbname varchar(50)
declare @id varchar(10)
set @dbname = 'database1'
set @id = '1001'
declare @sql nvarchar(3000)
set @sql = 'select top 5 table1.id, value
from server.'+@dbname+'.dbo.table1 table1,
server.'+@dbname+'.dbo.table2 table2
where table2.id = table1.otherid
and table1.id = '+@id+' '
exec sp_sqlexec @sql
I'm receiving this error:
Server: Msg 7405, Level 16, State 1, Line 1
Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.
After throwing in
set ansi_nulls on
go
set ansi_warnings on
go
or variations thereof before the script, the same error is still being returned. Any ideas, folks?