Re: Error using OPENROWSET



By default, SQL Server does not allow ad hoc distributed queries using
OPENROWSET and OPENDATASOURCE against providers other than the SQL Native
Client OLE DB Provider. You can allow this with a new sp_configure option.
Check the "Ad Hoc Distributed Queries Option" topic in Books OnLine.

--
Dejan Sarka
http://www.solidqualitylearning.com/blogs/

<larclap@xxxxxxxxx> wrote in message
news:1166172019.412378.158340@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have the following statement:

INSERT INTO MailHouse2.dbo.ClientUseCode
(ClientID, CountyFips, UseCode)
SELECT *
FROM OPENROWSET('SQLOLEDB.1','Provider=sqloledb.1;Data
Source=(localhost);Initial Catalog=MailHouse;uid=uid;pwd=pwd;',
'select 1 as ClientID,u.countyfipsid as CountyFips, u.usecodeid as
UseCode
from usecode u
inner join univusecodemap m on u.usecodepk=m.usecodefk
inner join compusecode c on u.usecodeid=c.usecode')

I know the inner select works because I've run it on the Mailhouse
(SQL2000) instance. However, when I run the entire query above from the
MailHouse2 (SQL2005) instance, I get the following error:

OLE DB provider "SQLNCLI" for linked server "(null)" returned message
"Deferred prepare could not be completed.".

Can someone help PLEASE?



.



Relevant Pages

  • Re: Enterprise Library - DataAccessApplicationBlock - MySql/DB2
    ... The fact that you set parameters differently for different providers isn't ... Oracle or Microsoft told me "We don't like the way you did that", ... ISDATE doesn't produce the same results in both Sql Server ... and Oracle both have a ton of specific features that others don't have. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Can you use the OleDb classes for SQL Server?
    ... William Vaughn ... Hitchhiker's Guide to Visual Studio and SQL Server ... I didn't mean using the same stored procedures for different RDBMSes. ... William it's better to use abstraction in the code such as providers and i ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ado vs oledb
    ... providers including SqlClient, ... like Odbc and OleDb which require ODBC drivers or OLEDB data providers to ... Hitchhiker's Guide to Visual Studio and SQL Server ... Between now and Nov. 6th 2006 you can sign up for a substantial discount. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connection to SQL Server on Vista
    ... The OP is using SQL Server 2000 not 2005. ... build versions and are now called "Data Access Components". ... In addition just telling someone to change providers with a working app is ... own providers so we will have SNAC, DAC (er, MDAC), and "ONAC". ...
    (microsoft.public.vb.database.ado)
  • [NT] MSDE, SQL Server 7 & 2000 Adhoc Heterogeneous Queries Buffer Overflow and DoS
    ... Microsoft SQL Server supports distributed queries by using OLE ... In SQL Server 7 overflow starts at character number 6819 and if the amount ...
    (Securiteam)