SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Multiple databases accessing one sql server file.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dolot
Starting Member

USA
8 Posts

Posted - 05/19/2014 :  13:31:09  Show Profile  Reply with Quote
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

USA
36941 Posts

Posted - 05/19/2014 :  14:13:32  Show Profile  Visit tkizer's Homepage  Reply with Quote
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

USA
8 Posts

Posted - 05/19/2014 :  14:23:39  Show Profile  Reply with Quote
How's the performance on that synonym?
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36941 Posts

Posted - 05/19/2014 :  14:27:50  Show Profile  Visit tkizer's Homepage  Reply with Quote
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

USA
8 Posts

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

tkizer
Almighty SQL Goddess

USA
36941 Posts

Posted - 05/19/2014 :  14:40:03  Show Profile  Visit tkizer's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000