Error while Running the Query using Linked server | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Error while Running the Query using Linked server

Hello – trying to run a query joining an existing SQL Server table to a table on a linked server (Sybase), and I get the following error: "Error 7405: 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." I have Executd the sp_dboption stored proc..even it is thro’ing 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. Regards
Sivaraman Latchapathi
http://www.windowsitpro.com/Articles/Index.cfm?ArticleID=15580&pg=2 —————————————-
http://spaces.msn.com/members/dineshasanka

PLease mention whether this is a problem on SQL Server 2005 instance? Satya SKJ
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
No Satya…I am using SQL Server 2000…while Running the Query in Query analyser it is giving the error…. I am just Runnig the Select Query Like :- Select * from LinkedServerCon.DBName.DBO.TableName Some Client of the M/c It is working, but some M/c it is giving Error.. Regards
Sivaraman Latcapathi
quote:Originally posted by satya PLease mention whether this is a problem on SQL Server 2005 instance? Satya SKJ
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.

that URL is not useful for me..any how thanks a lot
quote:Originally posted by dineshasanka http://www.windowsitpro.com/Articles/Index.cfm?ArticleID=15580&pg=2 —————————————-
http://spaces.msn.com/members/dineshasanka

Add this line before your query and it should do the trick: SET ANSI_NULLS ON SET ANSI_WARNINGS ON
GO
quote:Originally posted by sivaraman Hello – trying to run a query joining an existing SQL Server table to a table on a linked server (Sybase), and I get the following error: "Error 7405: 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." I have Executd the sp_dboption stored proc..even it is thro’ing 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. Regards
Sivaraman Latchapathi

Ensure both the SQL server are patched up to the similar levelsof service pack.
Another workaround is to create the stored procedure from Query Analyzer. Note that the default ANSI setting for Query Analyzer must be set to ON in order for this to work. Satya SKJ
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>