Monday, March 12, 2012

linked server direct query problem

Can anyone tell me what's wrong when I was successful to use:
select * from openquery(linkedservername,'select * from
catalogname.dbo.tablename')
However, when I used direct query:
select * from linkedservername.catalogname.dbo.tablename
and it failed with this error:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
OLE DB provider 'SQLOLEDB' reported an error. The provider did not give any
information about the error.
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IUnknown::QueryInterface
returned 0x80004005: The provider did not give any information about the
error.].
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
both dbes are SQL 2000 servers. Linked server was configured to use SQLOLEDB
as the provider...Try deleting the datasource information and just leaving the provider
string.
"bNguyen" <bNguyen@.discussions.microsoft.com> wrote in message
news:44825EF1-0AD5-407C-8E61-AA9234DE2BFA@.microsoft.com...
> Can anyone tell me what's wrong when I was successful to use:
> select * from openquery(linkedservername,'select * from
> catalogname.dbo.tablename')
> However, when I used direct query:
> select * from linkedservername.catalogname.dbo.tablename
> and it failed with this error:
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> OLE DB provider 'SQLOLEDB' reported an error. The provider did not give
any
> information about the error.
> OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IUnknown::QueryInterface
> returned 0x80004005: The provider did not give any information about the
> error.].
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> both dbes are SQL 2000 servers. Linked server was configured to use
SQLOLEDB
> as the provider...|||I am not sure I understood what you meant by deleting data source. When I
used direct query, I believe we must use four-part name in the statement to
reference linked server right? Please elaborate if you can... thanks
"Derrick Leggett" wrote:
> Try deleting the datasource information and just leaving the provider
> string.
>
> "bNguyen" <bNguyen@.discussions.microsoft.com> wrote in message
> news:44825EF1-0AD5-407C-8E61-AA9234DE2BFA@.microsoft.com...
> > Can anyone tell me what's wrong when I was successful to use:
> >
> > select * from openquery(linkedservername,'select * from
> > catalogname.dbo.tablename')
> >
> > However, when I used direct query:
> >
> > select * from linkedservername.catalogname.dbo.tablename
> >
> > and it failed with this error:
> >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > OLE DB provider 'SQLOLEDB' reported an error. The provider did not give
> any
> > information about the error.
> > OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IUnknown::QueryInterface
> > returned 0x80004005: The provider did not give any information about the
> > error.].
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > both dbes are SQL 2000 servers. Linked server was configured to use
> SQLOLEDB
> > as the provider...
>
>

No comments:

Post a Comment