Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Openquery in stored proc
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00849081
Message ID:
00849212
Views:
19
This message has been marked as the solution to the initial question of the thread.
Marc,

As I pointed out in my earlier post, "A stored procedure uses SET ANSI_NULLS settings at the time of it's creation. Any SET ANSI_NULLS inside stored procedure are ignored".
SET ANSI_NULLS ON
CREATE procedure dbo.asp_SetTmpImpPaye
...
You can find detailed explanation in SET ANSI_NULLS topic in BOL.

>I think the best help is that I give you my test.... here is my stored proc
>
>
>CREATE procedure dbo.asp_SetTmpImpPaye
>
>(
>	@Id_Usager int= null,
>	@Langue varchar(1) = '',
>	@DateDebut varchar(10) = '',
>	@DateFin varchar(10) = ''
>)
>
>as
>
>SET ANSI_NULLS ON
>SET ANSI_WARNINGS ON
>SET NOCOUNT ON
>
>begin
>	SELECT     *
>	FROM OPENQUERY(Datadis, 'select * from livre')
>end
>GO
>
>
>>>I pus those two settings on, but I still got the error.
>>
>>Where/how did you set them?
>>
>>>What is BOL ?
>>
>>"SQL Server Books Online" - SQL Server help.
>>
>>>
>>>>The OPENQUERY() (distributed query) requires
SET ANSI_WARNINGS ON
>>>>SET ANSI_NULLS ON
QA uses ODBC which sets both values to ON by default. A stored procedure uses SET ANSI_NULLS settings at the time of it's creation. Any SET ANSI_NULLS inside stored procedure are ignored. See BOL for more details.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform