Connection String for SQL server instance names

Alien777
10-27-2004, 06:01 AM
I have an SQL server on my local machine called:
IWDSWKS150\IWDSWKS150.
I have 2 databases: IJ_WDSTK_PRODUCTION and IJ_WDSTK_PROD_DATA_MART.
Most of my data is selected from IJ_WDSTK_PRODUCTION but sometimes I have to get some data from IJ_WDSTK_PROD_DATA_MART. When I do this I use this string:

SELECT ID, destination as description
FROM IWDSWKS150\IWDSWKS150.IJ_WDSTK_PROD_DATA_MART.dbo.Product_Destination ORDER BY description

but I keep getting the error message: Line 2: Incorrect syntax near '\'
When I execute select @@servername in query analyser, I get the result:IWDSWKS150\IWDSWKS150.
How can I get the query string to work?

Dennis DVR
10-27-2004, 07:51 AM
are these 2 database reside on the same server? if you just need to include the database name and the dbo in your select i.e.


SELECT [SAMPLE].dbo.[Table1].[sid],[SAMPLE2].dbo.[Table1].myname
FROM [SAMPLE].dbo.[Table1] LEFT JOIN [SAMPLE2].dbo.[Table1] ON
[SAMPLE2].dbo.[Table1].[sid]=[SAMPLE].dbo.[Table1].[sid]

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum