Ask a questionAsk a question
 

AnswerPrevent VSDBCMD :setvar DatabaseName in deploy script generation

  • Thursday, November 05, 2009 4:21 PMGreg Fricke Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I want to prevent the :setvar values coming through in my deployment.sql so I can pass them at sqlcmd.exe /p time.

    By default VSDBCMD is adding the :setvar for DatabaseName and DefaultDataPath to the top of the deploy.sql, is there anyway to suppress this?  Once those :setvar statements are there, I cannot override it later in a production server rollout using my sql.

Answers

All Replies

  • Thursday, November 05, 2009 4:55 PMGreg Fricke Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I answered my own questions, its under sqldeployment advanced options :)
    • Marked As Answer byGreg Fricke Thursday, November 05, 2009 4:55 PM
    •  
  • Friday, November 06, 2009 4:00 AMJohnM1 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    you would be better maintaining the use of those variables and updating the sqlcmdvars files during your deployment.

    how we do this in our environment is complex but very clean from a deployment perspective.

    all of our individual environments have central configs for each respective environment.

    during the deployment of the files to the servers we have processes which pickup the correct configs and replace the values throughout sqlcmdvars files using xpath replacements.

    this avoids the human error component of such a potentially dangerous situation.

    using the commandline seems like a wayto get into all sorts of trouble.