Solved

Sharing SQL Server objects

Posted on 2014-10-17
3
109 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 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 34

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Creating a SQLServer BI cube from Oracle data source 4 39
Server 2012 r2 and SQL 2014 6 33
SQL Server 2012 to SQL Server 2016 24 52
Remove () 9 36
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

739 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