SQL Merge 2 Databases

  • Hi geniuses!

    I need to merge 2 databases to colect information for my reports.

    Have really no clue about how to set things up.

    The query must be written into the query 'box' of the Dataset Properties, RIGHT?

    Thanks in advance.

    Regards!

  • What it looks like you need is a UNION clause, either in a stored proc on direct in the data set.

    SELECT

    1,2,3

    FROM

    DB1.dbo.Table2

    UNION / UNION ALL

    SELECT

    1,2,3

    FROM

    DB2.dbo.Table1

  • OK. Thanks!

    It is possible to relate 2 tables from different datasources?

    For example: I have Dataset1 from Datasource1 and Dataset2 from Datasource2.

    I want from Dataset1 : ProjectName;

    and from Dataset2 : ProjectStage. Which is in another DB.

    How do I do this and add these fields into the same tablix?

    Sorry if it sounds stupid, but I'm learning, this is all new for me.

    Thanks in advance.

    Regards

  • Not sure on that, you will need to build some sort of linking in 1 of the servers.

    Something like using linked servers, or building a merged database of both DB's using SSIS or something along them lines.

  • OK thanks anyway!

    What about linkin 2 tablix? Possible? Crazy stuff right?

    Regards.

  • again unsure, never had to do it, would be worth a google and if it is possible let us know how.

  • OK! In the mean time how do I create a Stored Procedure where I want data from 2 Databases.

    I want ProjectName from DB1 & ProjectStage from DB2.

    Thanks

    Best Regards

  • Something like the below

    SELECT

    DB1.ProjectName,

    DB2.ProjectStage

    FROM

    Database1.dbo.Table1 DB1

    INNER JOIN

    Database2.dbo.Table2 DB2

    ON

    DB1.ProjectStageID = DB2.ProjectStageID

    Without knowing your data schemas it is hard to say.

  • This not working for some reason.

    Instead, do you know a way to link different datasets from 2 different datasources in a tablix cell expression?

    Dataset1 from Datasource1

    Dataset2 from Datasource2

    Thanks

    Regards

  • Google it, I am unsure if it can be done.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply