Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Multiple databases accessing one sql server file.

Author  Topic 

dolot
Starting Member

8 Posts

Posted - 2014-05-19 : 13:31:09
We have a situation where we have multiple databases. Some of the data, however, in each database is reference data that is common to each database. Is there a way to put these tables into a separate .mdf file and have all of the databases access this one .mdf file to see the reference data? Most of the reference data will be read-only, but some of it will be written to occasionally by power users of the app.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-05-19 : 14:13:32
Yes you can put the reference data into its own database. You could add a synonym to the other databases so that it thinks the reference data is local. Or you could use a view, or cross the database via code.

I'd probably use the synonym if it were me.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

dolot
Starting Member

8 Posts

Posted - 2014-05-19 : 14:23:39
How's the performance on that synonym?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-05-19 : 14:27:50
No issues as long as the source database is on the same SQL instance. If it's on a remote SQL instance and the synonym uses a linked server, then you've possibly got performance issues due to the linked server.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

dolot
Starting Member

8 Posts

Posted - 2014-05-19 : 14:36:34
Thanks, Tara - you've been very helpful. How do you give reputation on this forum? :)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-05-19 : 14:40:03
The forum software doesn't have a way of doing that, but thank you!

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -