Multiple db access in vb.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to pull data from two separate DBs in SQL Server with the ability to
store a value (id) from db as a foreign key in the second db and display a
name associated with that id. I don't want to duplicate the Customer table
from the second db in the first db. Is there any way to do this?
 
Are you using Sql Server? If you are why don't you just do it in TSQL? You
can do cross db queries in tsql relatively easily. You just need to create
linked servers and do the following:

Select
From [dbserv1].DB1.dbo.Customers

Union

Select [dbserv2].DB1.dbo.Customers


Union would take care of the duplicates for you."Union All" would include
duplicates.
 
Back
Top