2

Im trying to work on a database after importing it into a sql server database project. There are procedures that refer to another database on the same server, but its a monster and id rather not import that database into the solution. Ive created a dacpac file with sqlpackage.exe and referenced that from the project Im working on, but I still get build errors with unresolved references. On the reference itself, Ive set "Suppress Reference Warnings" to true.

When I add the reference its wanting to use a variable, so that means I would have to change all my code to use that variable?

[update] I think I found my answer here http://www.codeproject.com/Articles/565459/FixingplusSSDTplusunresolvedplusreferenceplustoplu

summary - I would have to modify the code that refers to the 2nd database by using the variable name from the reference. At build time, the variable is replaced with the actual name. A secondary benefit is that this 2nd database could be renamed and only the reference would have to change.

bitshift
  • 6,026
  • 11
  • 44
  • 108
  • Good for you. What's the question? – Chris Pickford Jun 16 '16 at 13:32
  • Sorry for the confusion Chris, I only had the question in the title. – bitshift Jun 16 '16 at 14:27
  • You can remove the variable piece from your database reference (maybe just when creating it) and have it set to a fixed database name to avoid having to change the code. If you never use different DB names, this is ideal and makes for easier compares. You do need to have that DB Reference in your project if you call to it from views/procs/functions, though, or at least a reference to a partial project containing the called objects. – Peter Schott Jun 17 '16 at 12:34

0 Answers0