x

An interesting question about joining two databases

How can I join a data mart and Northwind to populate the fact table in the same data mart?

more ▼

asked Mar 03 '10 at 09:07 PM in Default

SA gravatar image

SA
1 3 3

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

If these databases are on the same server/instance you can do this using three part name syntax, see below.

select
D.*
,N.*
from
DataMart.dbo.TablefromDataMart D
join
Northwind.dbo.Employees N
on
D.KeyField = N.KeyField
more ▼

answered Mar 04 '10 at 07:21 PM

Jason Cumberland gravatar image

Jason Cumberland
507 2

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x235

asked: Mar 03 '10 at 09:07 PM

Seen: 375 times

Last Updated: Mar 03 '10 at 09:07 PM