Re: ANSI_WARNINGS error in Stored Procedure
From: Russell Fields (RussellFields_at_NoMailPlease.Com)
Date: 01/16/04
- Next message: Kevin McDonnell [MSFT]: "RE: Problem with MDAC update?"
- Previous message: Russell Fields: "Re: Linked Server to Access DB - ERROR"
- In reply to: Noe: "ANSI_WARNINGS error in Stored Procedure"
- Next in thread: Noe Carranza: "Re: ANSI_WARNINGS error in Stored Procedure"
- Reply: Noe Carranza: "Re: ANSI_WARNINGS error in Stored Procedure"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 16 Jan 2004 15:43:38 -0500
Noe,
>From the error I would understand that the linked server is not a Microsoft
SQL Server. Otherwise, how likely is it that the SQL Engine would be
concerned with "heterogeneous queries".
The error says to set these options for your _connection_ not for the query.
Since you are already connected before you try to compile the stored
procedure, it is too late for the SET commands to avoid the problem.
If you are using Query Analyzer to test this, then go to the menu item for
the connection and click these two settings on. (I believe that these are
normally set on by OLE DB / ODBC, but Query Analyzer may override these
settings.)
Russell Fields
"Noe" <noech77@hotmail.com> wrote in message
news:D4F795B7-C67A-4F28-B95D-85B5FF7C7293@microsoft.com...
> Hi everyone,
>
> I have a linked Server on my regular SQL server, and when I try to create
a stored procedure that reads from the linked server, 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 QUERIES
SEMANTICS. ENABLE THESE OPTIONS AND THEN REISSUE YOUR QUERY.
>
> When I click Check Syntax, it says that there are no Syntax Errors, but it
wont let me save the stored procedure. I did put "SET ANSI_NULLS ON" and
"SET ANSI_WARNINGS ON" in the stored procedure, but I keep getting the same
error.
>
> The query that is to be performed in the stored procedure is a simple
SELECT, no inner joins or anything. And the stored procedure receives only 1
(integer) parameter.
>
> Thanks in advance for your help.
>
> Noe, from Mexico.
- Next message: Kevin McDonnell [MSFT]: "RE: Problem with MDAC update?"
- Previous message: Russell Fields: "Re: Linked Server to Access DB - ERROR"
- In reply to: Noe: "ANSI_WARNINGS error in Stored Procedure"
- Next in thread: Noe Carranza: "Re: ANSI_WARNINGS error in Stored Procedure"
- Reply: Noe Carranza: "Re: ANSI_WARNINGS error in Stored Procedure"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|