질문하기질문하기
 

답변됨A question about "setvar" and deployment

  • 2009년 6월 30일 화요일 오후 6:10Daniel Pratt 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    It seems that if I want to be able to deploy changes to a database from a project (via the "Deploy" action), I have to live with the fact that there will be hard-coded ":setvar" statements in the generated script to set the target database. Is this correct?

    I ask because the script takes quite a while to generate and I have a high degree of confidence that the generated script will be appropriate for other databases as well. Thus I want to re-use the script, supplying a different database as a parameter to SQLCMD.

    I see that there is an option to "comment out" the ":setvar" statements, which would allow me to specify a value for those parameters via SQLCMD. Unfortunately, this also prevents the "Deploy" target of the project from being able to automatically update the target database.

    If there is a way that I can have my cake and eat it too, please let me know :)

    Thanks,
    Daniel

답변

  • 2009년 6월 30일 화요일 오후 7:20Barclay HillMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨
    Daniel,

    You can have your cake and eat it too.  Database.sqldeployment options can be customized per configuration.  This will allow you to deploy with setvars for DEBUG and deploy to script without setvars for Release or however you want to define your configurations.

    Thanks,
    Barclay Hill Program Manager VSTS: DB Team (DataDude, DBPro, Database Edition) Please mark the responses as answer if it resolves your question.

모든 응답

  • 2009년 6월 30일 화요일 오후 7:20Barclay HillMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨
    Daniel,

    You can have your cake and eat it too.  Database.sqldeployment options can be customized per configuration.  This will allow you to deploy with setvars for DEBUG and deploy to script without setvars for Release or however you want to define your configurations.

    Thanks,
    Barclay Hill Program Manager VSTS: DB Team (DataDude, DBPro, Database Edition) Please mark the responses as answer if it resolves your question.