Monday, March 26, 2012

is it possible to grab data from 2 different databases

Hello-

I have a chart I am producing in .net and I need to values. The problem is the values (sums) i need are on 2 different servers. Is there any where to combine the query using two databases? Does anyone have any suggestions?

thanksYou may try to use something like:

"SELECT a.*, b.* FROM DB1..TableA a INNER JOIN DB2..TableB b ON a.WhatID = b.WhatID"

Regards,|||but they are on two different servers.. How would I set up the connection string for that?|||With that scanerio, what I have done is issued a sp_addlinkedserver from SERVER1 to link to SERVER2. Then you can access SERVER2 through SERVER1 by using a fully qualified table name: SELECT * FROM Server2.Database2.dbo.Table1.

Terri|||what is a sp_addlinkedserver and how do i set this up?

thanks|||Looks like we straightened this out in another thread:view post 458481

Terrisql

No comments:

Post a Comment