Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Syntax - Query Multiple Instances

Status
Not open for further replies.

Smeat

Programmer
Mar 27, 2004
193
0
0
GB
I have a stored procedure running on sql server A that needs to pull data from sql server B.

Sql server B has been linked to sql server A.

What is the syntax to query sql server B when sql server B has an instance name specified?

I.e. SELECT field1, field2 FROM ServerName\InstanceName.DatabaseName.dbo.TableName

This query won't run as it doesn't like the "\" character.

TIA
Smeat
 
Code:
SELECT field1, field2 
       FROM [LinkedServerName].[DatabaseName].[dbo].[TableName]
Where "LinkedServerName" is the name of the linked server created on Server A.

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top