Multiple db access in vb.net

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?
 
B

Brent

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top