ANSI_WARNINGS error in Stored Procedure

From: Noe (noech77_at_hotmail.com)
Date: 01/16/04


Date: Fri, 16 Jan 2004 10:26:08 -0800

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.



Relevant Pages

  • Re: User-Defined Function
    ... It doesn't even have to be this elaborate with a linked server. ... Declare @line varchar ... suitable extended stored procedure. ... > server setup and an example of how to get directory information (but not ...
    (microsoft.public.sqlserver.programming)
  • RE: Stored Procedure to Connect a DBF File
    ... but you might be able to create a Linked Server to the ... after setting up an ODBC connection to it. ... > of DBF file using / with in the Stored Procedure? ...
    (microsoft.public.sqlserver.programming)
  • Facing the same problem
    ... My stored procedure is being activated from a Service Broker ... queue. ... The linked server is a SQL server, but not one where I have any ...
    (microsoft.public.sqlserver.security)
  • RE: Stored Procedure to Connect a DBF File
    ... but you might be able to create a Linked Server to the ... after setting up an ODBC connection to it. ... > of DBF file using / with in the Stored Procedure? ...
    (microsoft.public.sqlserver.server)
  • Linked server problems
    ... I am trying to update records in ... a table on a linked server and it will not use the index despite the fact ... When I take the same query and run ... stored procedure on the linked server rather than a straight UPDATE ...
    (microsoft.public.sqlserver.security)