Solved

Sharing SQL Server objects

Posted on 2014-10-17
3
104 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
3 Comments
 
LVL 17

Accepted Solution

by:
OriNetworks earned 500 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 32

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now