Unresolved Reference in Visual Studio 2012 Database Project

后端 未结 1 353
忘了有多久
忘了有多久 2021-01-20 22:00

Is there a way to reference another database from my database project without directly referencing it?

For example, I want to be able to write something like this:

1条回答
  •  囚心锁ツ
    2021-01-20 22:13

    Your best bet is to add a database reference to your project. For VS2010 and lower DBProj files, you'll want to generate a dbschema file and add it as a database reference. For SSDT, you'll want to use a dacpac file. This works well for projects that are mostly static and you can even tailor them down to just include the objects that are relevant.

    VS2010, 2008 - http://msdn.microsoft.com/en-us/library/dd193283%28v=VS.90%29.aspx has the documentation you'll need to export an existing database into a dbschema file. Place it somewhere your project can access it and add it as a "Database Reference".

    SSDT - http://msdn.microsoft.com/en-us/library/hh550080%28v=VS.103%29.aspx gives you the command line reference for generating a dacpac file. Once generated, place it somewhere your project can access it and add as a database reference.

    I've got a blog post on this for SSDT here: http://schottsql.blogspot.com/2012/10/ssdt-external-database-references.html

    0 讨论(0)
提交回复
热议问题