?
Solved

Sharing SQL Server objects

Posted on 2014-10-17
3
Medium Priority
?
114 Views
Last Modified: 2014-10-18
I'm by no means a Sql server expert and need some basic help. I have 2 completely separate sql files attached. For example, File 1.mdf and File 2.mdf. I need to modify data in File 1.mdf based on reference tables in File 2.mdf.

Is it even possible to construct a query using both files?

My original thought was to export the files to MS Access to make the changes but File 1.mdf exceeds the 2 Gbyte Access limit so I'm stuck with how to do this in Sql Server directly.

Ideas anyone?
0
Comment
Question by:SpaceCoastLife
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 17

Accepted Solution

by:
OriNetworks earned 2000 total points
ID: 40386589
You can write cross database queries in each database or setup views to access a different database.

In DB1, you can update a table in DB2 like this
Update DB2.dbo.Table1 SET qty=1 WHERE ID=1

In DB2, you can do the same things to update a table in DB1 like this
Update DB1.dbo.tbl SET thiscolumn=1 WHERE ID=1
0
 
LVL 35

Expert Comment

by:ste5an
ID: 40386603
D'oh? .mdf files are the database file. As long as you don't want to reinvent the wheel and code your own SQL server

So, can you please rephrase your question and tell us what you're trying to do actually?
0
 

Author Closing Comment

by:SpaceCoastLife
ID: 40388974
Found an easier way to accomplish this but thanks for the input anyway.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question