How to Select Tables in Different SQL SERVER 2008 and 2012 Databases

Asked

Viewed 764 times

0

Currently I have 1 database in SQL SERVER 2008R2 and another SQL SERVER 2012.

I HAVE AN APPLICATION THAT USES THE BASIS IN 2008R2 AND I NEED TO CONSULT DATA THAT IS IN 2012. WHICH IS THE BEST WAY?

1 answer

1


As in the mysql response that rLinhares quoted in the comment, just specify the full path of the table:

[server]. [database]. [schema]. [table]

Example:

select *
from tabelaBancoAtual t1
inner join banco2.dbo.tabelaOutroBanco t2
on t1.idFk = t2.id

Browser other questions tagged

You are not signed in. Login or sign up in order to post.