Link to home
Create AccountLog in
Avatar of blossompark
blossomparkFlag for Ireland

asked on

linked server error in sql server 2005

Hi,
I have created a linked server from serverA to serverB using
EXEC sp_addlinkedserver @server='serverB'

When I fire the following query from serverA
select * from openquery (serverB, 'SELECT * from serverB.northwind.dbo.employees')

I get the following error
OLE DB provider "SQLNCLI" for linked server "serverB" returned message "Deferred prepare could not be completed.".
Msg 14, Level 16, State 1, Line 1
[DBNETLIB][ConnectionOpen (Invalid Instance()).]Invalid connection.

any help appreciated...thanks

ASKER CERTIFIED SOLUTION
Avatar of Alpesh Patel
Alpesh Patel
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of blossompark

ASKER

i PatelAlpesh,
both these work
select * from openquery (serverB, 'SELECT * from northwind.dbo.employees')
SELECT * from serverB.northwind.dbo.employees

I thought i had to use OPENQUERY for a linked server but maybe not...
thanks for your help...all ok now :-)