Solved

Sharing SQL Server objects

Posted on 2014-10-17
3
106 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 33

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

911 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

20 Experts available now in Live!

Get 1:1 Help Now