I have a SQL file like this
-- Comment
DROP DATABASE [$(DbName)]
When I run sqlcmd -i input.sql -v DbName=MyDatabase, I get error
Database '$(DbName)' does not exist. Make sure that the name is entered correctly.
If I remove the comment on line 1, the script executes successfully.
This used to work with the old sqlcmd.