Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Heterogeneous queries over 2 servers

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-08-05 : 08:12:39
Nephilim writes "Hi!

I've got a problem concerning insert/update/delete statements across 2 servers. What I want to do is to do an insert in a SQL 7 (SP2) server table, starting a trigger that does an insert into a SQL Server 2000 (SP2) table.

This is pretty easily achieved using standard trigger logic, i.e doing a simple insert across server in the form

insert into ServerName.dbName..TableName .....

Writing an insert-query and running it in QueryAnalyzer also results in the desired effect, that is a new post in the SQL 2000 table.

The problem is that the insert statement is, in reality generated by a buisness-system, which does the first insert in a different manner, resulting in an error stating :

"MsgNo: 7405 State: 1 Severity: 16
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."

Setting these options was obviously the first thing I tried, but this didn't help.
Even when I get this error, I can verify that the options mentioned is indeed set correctly.

I also should mention that the first table has other triggers running on it, but none of those has set the ANSI_WARNINGS or ANSI_NULLS to anything. (Which should mean that they run on the default values.)

So : How do I avoid this problem...?"
   

- Advertisement -