I get the error
Missing values for the following SqlCmd variables:Path1 Path2.
in a few Sql Projects in Visual Studio.
I tried googleling it but found nothing.
I hit this issue. I'd added some SQLCMD variables then deleted them. The SQLCMD variables no longer existed in the publish files or the .sqlproj file. I grepped all the files in the project and the variables didn't exist anywhere. I'd restarted Visual Studio. However I was still getting the Missing values for the following SqlCmd variables: error.
From the project directory I deleted the *.dbmdl and *.sqlproj.vspcc files. The project then published successfully.
Select the SQL project. Go to project's properties (ALT + Enter). Navigate to SQLCMD Variables and act accordingly (either remove the variables or fill in the default values).
I ran in to this yesterday after tinkering with the project settings for my database project (right-click the database project, click properties, then click the Project Settings).
I had checked the Create script (.sql file) option and things continued to work as normal for me. But when another team member checked out the the latest update, they could not build and got the error about missing values for SqlCmd variables. Things still worked for me though until I checked out a fresh version of the source and started getting the same error.
To fix, I simply unchecked the Create script (.sql file) setting and all was well again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With