referencing a different Database who are on the same server RRS feed

  • Question

  • I am trying to use the Database Project to build my data warehouse. The SourceData Database and the Wharehouse Database are on the same server.

    I would like to use my SourceData db as the datasource for Wharehouse db. WhareHouse db would contain views that will enable me to query the SourceData.
    The resulting SQL would look like this:

    USE Wharehouse

    Create view TheDataTable
     as select * from SourceData.dbo.TheSourceTable

    The problem is that when I import a dbSchema it adds it to the Wharehouse db. I would like to be able to reference the SourceData db through it's full name.

    Right now I can write this code below, but it will fail once deployed.

    select * from Wharehouse.dbo.theSourceTable.

    I currently use VS2008 for the Database but I wouldn't mind using 2010 for the database project.

    Anu help would be appreciated

    Tuesday, May 17, 2011 7:01 PM

All replies