x
login about faq Site discussion (meta-askssc)

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

(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.

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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x210

asked: Mar 03 '10 at 09:07 PM

Seen: 228 times

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

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.