Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need two databases in the same server to be linked.
So when changes have been made in database 1, it will affect the database 2 too.

What I have tried:

- I've tried linked servers but the databases isnt visible in the linked database.
- i also tried query to link tables instead but there are hundred of tables in my database so it is time consuming
- i encounter this https://support.office.com/en-us/article/import-or-link-to-data-in-an-sql-server-database-a5a3b4eb-57b9-45a0-b732-77bc6089b84e but this one is using MS Access and SQL server. But i want to the linking to be in between the MSSQL only

im using MSSQL Server Management Studio 2018
Posted
Updated 21-Oct-19 2:47am

Maybe this article will be helpful: Understanding SQL Server Linked Servers[^]

Also see: SQL Server Replication - SQL Server | Microsoft Docs[^]

If that does not help you might consider something like this: database-cluster-managers~symmetricds[^]
 
Share this answer
 
v2
If you use the same USER for both database you can JOIN them in any Query sinces both database are IN the same server.
IE:
SELECT *
FROM [dbName1].[schema].[Table] as t1
JOIN [dbName2].[schema].[Table] as t2 on t2.<field> = t1.<field>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900