Friday, March 30, 2012

linked server query

Hi,
I have added a linked server. Now , how can I query the tables and also I
only see one of the few databases only on the linked server. How can I see
all the databases of linked server.
Thanks,
Via the linked server you will see your 'default database' objects on that
target database. Although you cannot graphically browse the multiple
databases that you have access to on the target linked server, you will be
able to access those other databases and tables via querying.
When querying the databases on the linked server, make sure to set your ANSI
settings and issue the queries using the 4-part object context:
ex:
USE ANSI_NULLS ON
GO
USE ANSI_WARNINGS ON
GO
SELECT name FROM <LINKEDSERVERNAME>.Northwind.dbo.Customers
Replace <LINKEDSERVERNAME> with the name of the linked server
"dotnettester" wrote:

> Hi,
> I have added a linked server. Now , how can I query the tables and also I
> only see one of the few databases only on the linked server. How can I see
> all the databases of linked server.
> Thanks,
>
|||Hi,
Before u query to linked server table see in linked server property
that rpc option are checked.
use the select * from [linked
servername].databasename.username.tablename
hope this help
from
killer

No comments:

Post a Comment