• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

Shared (Linked) Tables in MS SQL Server

I plan to move some applications I have in MS Access over to MS SQL Server & C#.  There are several applications, and they all share a few of the same tables.  I don't want to combine all the applications' tables into one big database, because most users will not have all of the applications.  Also, I may build additional applications that share the same tables.  I'd rather not replicate the same shared tables in each application's database.  Is there a way that I could have these shared tables in a separate database that is linked some way to the other applications' databases?

Thanks!
0
StumpedAndGrateful
Asked:
StumpedAndGrateful
  • 2
2 Solutions
 
tigin44Commented:
in sql server you may have different databases for yor need.. if you need to reference to an object from a different database then you can reference it by using the

   dbname.schemaname.objectname

0
 
tigin44Commented:
a simple example

SELECT *
FROM DB1.dbo.table1 T1
   INNER JOIN DB2.dbo.table2 T2 ON T1.id = T2.id
0
 
itsdivyaksCommented:
If both the databases reside in the same server, then you can refer using DBName.dbo.Table. If you are using different servers to place the database, then you have to add the server as linked server and use open query
0
 
StumpedAndGratefulAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now