Friday, February 24, 2012

connection err

hi

i use sql 2005 and i create view from linked server

when i select from the view it's o.k

but in the app. i get thes messge :

42000 [Microsoft][SQL Native Client][SQL Server]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.

how can i resolve this problam

thenk's

You could try doing:

set ANSI_NULLS on

go

set ANSI_WARNINGS on

go

<select from your view>

instead of just:

<select from your view>

hope that helps,

John

|||

hi

i do this

but no

when i run the proc. or select on the view it is o.k

i get the err when i use the app. (uniface)

it is look like the odbc

thenks

|||

When you execute the QUERY from the application, SET the ANSI settings appropriately, something like this:

SET ANSI_NULLS ON; SET ANSI_WARNINGS ON; SELECT Col1, Col2, etc FROM MyTable WHERE {criteria}

Try the entire line above as the command string. (Or put it into a stored procedure and just call the stored procedure.)

|||


This is sometimes based on the problem that the views are not created with the right ANSI settings, so use

SET ANSI_NULLS ON
GO
SET ANSI_WARNINGS ON
GO

CREATE VIEW SOMEVIEW....

Jens K. Suessmeyer.

http://www.sqlserver2005.de
--

1 comment:

Unknown said...

Enable heterogeneous queries in your ASN

[DRIVER_SETTINGS]

USYS$MSS_PARAMS sql92npw = on

Post a Comment