Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Using Multiple data Sources

Author  Topic 

snufse
Constraint Violating Yak Guru

469 Posts

Posted - 2008-01-24 : 15:45:46
Not sure if this is possible, here is the scope:

I have a vb program that calls a sp. My vb program connects to DataSource1, Catalog1 and to DataSource2, Catalog2. My sp resides in Catalog1 using a table from catalog1 and a table from catalog2.

Is this possible to do?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-01-24 : 15:53:14
yes. use 3 or 4 part naming convention.
serverName.dbName.schemaName.tableName
or
dbName.schemaName.tableName


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out
Go to Top of Page

snufse
Constraint Violating Yak Guru

469 Posts

Posted - 2008-01-25 : 08:55:34
Here is how I have qualified the path using 4 part naming in my sp:

SELECT vgiwpw03-sql3/equentialprod.goLabor30.Batch.ReportDate AS job_date

I also tried this:

SELECT 'vgiwpw03-sql3\equentialprod.' + goLabor30.Batch.ReportDate AS job_date

My vb program gives me error when calling the sp:

Invalid object name 'Batch'

My server is VGIWPW03-SQL3\EQUENTIALPROD and database = goLabor30 and table = batch

Go to Top of Page
   

- Advertisement -