Is it possible to list 2 tables from 2 different banks?

Asked

Viewed 654 times

4

I’m looking to relate 2 different database tables. I’m using SQL Server SSMS 17.9.1.

TBL1 in DB1
TBL2 in DB2

Scenarios:

  1. Both banks are on the same server;
  2. Database 1 is on my server and database 2 is on an external server.

Would there be a way out of these two scenarios? Initially the two banks will be on the same server, but later the BD 2 can go to another server.

  • 1

    Yes, with SELECT is possible yes. And if the two banks are on different servers, but communicate with each other, it is also possible.

  • how I would do this SELECT with an external bank ?

  • As far as I know, although it is possible to access another database via FDW (Foreign Data Wrapper) in the SQL/MED standard, it is not possible to define a Constraint between different databases.

  • 2

    Have you researched LINKED SERVER ? https://docs.microsoft.com/pt-br/sql/relational-databases/linked-servers/create-linked-servers-sql-server-database-engine?view=sql-server-2017

  • @Edvaldolucena no, had never seen LINKED SERVER, I’m already taking a look at the link, thanks for the tip.

1 answer

-2

Browser other questions tagged

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