princessk1
Programmer
I am trying to access tables from differnet databases in a stored procedure and I am getting error 7405:
Heterogenous queries require the ANSI_NULLS & ANSI_WARNINGS options to be set for the connection.
I have tried going into the control panel under the ODBC connection and selecting the options there but I still get the error. I have also tried setting them in the code:
SET ANSI_NULLS ON
SET ANSI_WARNINGS ON
This also does not work.
Any ideas????
The line in my code that is causing the error is:
DECLARE store_cursor CURSOR FOR SELECT StoreID,StoreNo FROM LWIDWDRV.LWISales.dbo.Store WHERE EndDate = '1900-01-01'
If I take out the .dbo the error goes away but I get an invalid database error when I try to run the stored procedure.
Thanks.
Heterogenous queries require the ANSI_NULLS & ANSI_WARNINGS options to be set for the connection.
I have tried going into the control panel under the ODBC connection and selecting the options there but I still get the error. I have also tried setting them in the code:
SET ANSI_NULLS ON
SET ANSI_WARNINGS ON
This also does not work.
Any ideas????
The line in my code that is causing the error is:
DECLARE store_cursor CURSOR FOR SELECT StoreID,StoreNo FROM LWIDWDRV.LWISales.dbo.Store WHERE EndDate = '1900-01-01'
If I take out the .dbo the error goes away but I get an invalid database error when I try to run the stored procedure.
Thanks.