none
SSDT HOW TO create a second project for same database and same server RRS feed

  • Question

  • Hi all, I would like to create CLR addons which are compiled into more than one assembly. This is necessary, because the assemblies need different AUTHORIZATION and PERMISSION_SETS.

    In 2012 a similar question was answered to create a new project for same database on same server and reference it. Looks like a nice solution.

    But here is my problem: How can I create an new project for the same physical database? I could not find any dialog where I can specify an existing database in a new project. Is there another solution or do I suffer from a blind spot?


    Regards Jörg


    • Edited by Jörg Debus Wednesday, February 4, 2015 5:43 PM
    Wednesday, February 4, 2015 5:43 PM

Answers

  • Hello Jörg

    This can be easily done. First add a second project to your solution. From your first data project right click on the "references" node in the solution explorer. From the context menu select "Add Database Reference...". 

    In the "Add Database Reference" dialog select the second project. In the Data Location section of the dialog, change "Different database, same server" to  "Same database". Then press OK.

    At this point when you deploy your first project it will deploy both projects into the same database.

    I hope this helps.

    Lonny

    Tuesday, February 10, 2015 6:06 AM

All replies

  • Hello Jörg

    This can be easily done. First add a second project to your solution. From your first data project right click on the "references" node in the solution explorer. From the context menu select "Add Database Reference...". 

    In the "Add Database Reference" dialog select the second project. In the Data Location section of the dialog, change "Different database, same server" to  "Same database". Then press OK.

    At this point when you deploy your first project it will deploy both projects into the same database.

    I hope this helps.

    Lonny

    Tuesday, February 10, 2015 6:06 AM
  • Hi Lonny,

    thanks a lot! In addition I learned much about the secrets of database references ;-)

    BTW to other readers: The database has to be labeled THRUSTWORTHY ON which can only be achieved by setting it in the project's properties (Database -> Miscellaneous).


    Regards Jörg


    • Edited by Jörg Debus Wednesday, February 11, 2015 11:04 AM
    Wednesday, February 11, 2015 11:04 AM