9

I'm trying to set SQLCmd variables based on configuration (Debug / Release, etc) but the Configuration dropdown is greyed out (see image below). For Dev environment, I want the SQLCmd variable to be Stage, for the Release environment, Prod.

I can't figure out an easy way to do this without going into the properties. We have 9 projects and about 6 variables each. Each time we do a schema comparison we have to manually change the variables and it's very tedious.

Our publish scripts are fine for the different environments, it's just setting up for schema compare that makes it time-consuming.

enter image description here

Gabe
  • 5,113
  • 11
  • 55
  • 88
  • 1
    Would Publish Profiles work? They wouldn't help you for schema compares, but they'd help with actually pushing or generating scripts/diff reports. – Peter Schott Oct 09 '14 at 17:53
  • I am trying to do the exact same thing - did you ever figure out how to do this? – Leslie Jul 31 '15 at 16:13
  • FYI, SSMS is pseudo Visual Studio. Meaning it utilizes a lot of the same UI but not necessarily all the options. As SSMS (older) did not need this functionality and capability, they probably disabled by nature. You can probably use the SQL Tools for Visual Studio to get some of the same functionality. Might want to consider why you are doing what you are doing and if Dynamic SQL Would be a better fit than SQLCMD – GoldBishop Sep 24 '15 at 15:39

0 Answers0