How can I test sql scripts intended to run with sqlcmd -v in Sql Server Management Studio From msdn I learn, that the Variable Precedence of :Setvar X Y is higher, than that of sqlcmd -v X=Y.

I want to write a script, that uses the variables supplied to sqlcmd with the -v option, but which uses some default values, when run in Management Studio using SQLcmd mode.

Best there would be some way to supply the values to use somehow to the Management Studio without having to provide them in the script.
The precedence of setvar is the lowest.  Try it out and see if it works.