locked
Question about publish profiles RRS feed

  • Question

  • I have a database project added to my solution along with my web application and a few associated class libraries.  Several web.config transforms have been added, along with associated build targets.  Now as regards the database project, I was reviewing this article here, but I dont see the checkbox "Add Profile to Project" option.  Why not?  My target DB is 2008.  Is this something specific to 2012 and later?

    http://arcanecode.com/2012/08/07/sql-server-data-tools-in-visual-studio-2012publish-database-profile/

    Questions:
    What could be preventing that checkbox from showing up?
    Can this be driven from MSBuild and if so, what are the associated requirements for this?  In other words, is Visual Studio required?
    How can I handle static data that needs to get migrated as well?
    How can I associate each profile with a build configuration in the project?

    [update]

    At least with my situation, it looks like the buttons "Create Profile" is what I want to use.  Doing this, while modifying the names of the profile and script(s), let me setup publish profiles.

    This might be a better example of what Im trying to do, since Im using TeamCity to automate this process. 

    https://simonlearningsqlserver.wordpress.com/2014/06/19/using-teamcity-to-build-and-deploy-ssdt-projects/


    • Edited by shiftbit Tuesday, October 13, 2015 7:27 PM sdfgsdfg
    Tuesday, October 13, 2015 6:56 PM

Answers

  • I have a database project added to my solution along with my web application and a few associated class libraries.  Several web.config transforms have been added, along with associated build targets.  Now as regards the database project, I was reviewing this article here, but I dont see the checkbox "Add Profile to Project" option.  Why not?  My target DB is 2008.  Is this something specific to 2012 and later?

    http://arcanecode.com/2012/08/07/sql-server-data-tools-in-visual-studio-2012publish-database-profile/

    Questions:
    What could be preventing that checkbox from showing up?
    Can this be driven from MSBuild and if so, what are the associated requirements for this?  In other words, is Visual Studio required?
    How can I handle static data that needs to get migrated as well?
    How can I associate each profile with a build configuration in the project?

    [update]

    At least with my situation, it looks like the buttons "Create Profile" is what I want to use.  Doing this, while modifying the names of the profile and script(s), let me setup publish profiles.

    This might be a better example of what Im trying to do, since Im using TeamCity to automate this process. 

    https://simonlearningsqlserver.wordpress.com/2014/06/19/using-teamcity-to-build-and-deploy-ssdt-projects/


    Hi Shiftbit,

    I am not sure why the checkbox is not there (see Steven's answer for that), regarding:


    How can I handle static data that needs to get migrated as well?

    I find the easiest is to put a MERGE statement in your post deployment script - if you don't want to create them by hand then you can use sp_generate_merge (https://github.com/readyroll/generate-sql-merge/blob/master/master.dbo.sp_generate_merge.sql).

    Can this be driven from MSBuild and if so, what are the associated requirements for this?  In other words, is Visual Studio required?

    I find that the easiest way to handle database dpeloyments in a ci/cd process is to use msbuild to generate the output dacpac and then use sqlpackage.exe to take that dacpac and deploy it to a server, either an Exec task in your projects or individual build steps on your build server. 

    If you do that then for each step you can either specify the correct arguments or pass in a publish profile with the arguments in that you need.

    Hope it helps.

    ed

    • Marked as answer by shiftbit Wednesday, October 14, 2015 12:12 PM
    Wednesday, October 14, 2015 8:20 AM
  • That article has screenshots from an earlier version of SSDT. As you've observed the publish dialog has changed a bit since then.

    Tuesday, October 13, 2015 7:15 PM

All replies

  • That article has screenshots from an earlier version of SSDT. As you've observed the publish dialog has changed a bit since then.

    Tuesday, October 13, 2015 7:15 PM
  • I have a database project added to my solution along with my web application and a few associated class libraries.  Several web.config transforms have been added, along with associated build targets.  Now as regards the database project, I was reviewing this article here, but I dont see the checkbox "Add Profile to Project" option.  Why not?  My target DB is 2008.  Is this something specific to 2012 and later?

    http://arcanecode.com/2012/08/07/sql-server-data-tools-in-visual-studio-2012publish-database-profile/

    Questions:
    What could be preventing that checkbox from showing up?
    Can this be driven from MSBuild and if so, what are the associated requirements for this?  In other words, is Visual Studio required?
    How can I handle static data that needs to get migrated as well?
    How can I associate each profile with a build configuration in the project?

    [update]

    At least with my situation, it looks like the buttons "Create Profile" is what I want to use.  Doing this, while modifying the names of the profile and script(s), let me setup publish profiles.

    This might be a better example of what Im trying to do, since Im using TeamCity to automate this process. 

    https://simonlearningsqlserver.wordpress.com/2014/06/19/using-teamcity-to-build-and-deploy-ssdt-projects/


    Hi Shiftbit,

    I am not sure why the checkbox is not there (see Steven's answer for that), regarding:


    How can I handle static data that needs to get migrated as well?

    I find the easiest is to put a MERGE statement in your post deployment script - if you don't want to create them by hand then you can use sp_generate_merge (https://github.com/readyroll/generate-sql-merge/blob/master/master.dbo.sp_generate_merge.sql).

    Can this be driven from MSBuild and if so, what are the associated requirements for this?  In other words, is Visual Studio required?

    I find that the easiest way to handle database dpeloyments in a ci/cd process is to use msbuild to generate the output dacpac and then use sqlpackage.exe to take that dacpac and deploy it to a server, either an Exec task in your projects or individual build steps on your build server. 

    If you do that then for each step you can either specify the correct arguments or pass in a publish profile with the arguments in that you need.

    Hope it helps.

    ed

    • Marked as answer by shiftbit Wednesday, October 14, 2015 12:12 PM
    Wednesday, October 14, 2015 8:20 AM
  • @ Ed-Elliot - regarding sqlpackage.exe, is something like this what you are referrign to ?

    http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/

    Wednesday, October 14, 2015 12:06 PM
  • yes exactly, I go into it more:

    https://the.agilesql.club/blog/Ed-Elliott/Visual-Studio-SSDT-Publish-My-Personal-Best-Practices

    ed

    Wednesday, October 14, 2015 12:15 PM