5

I'm confused, if I select the "Create a deployment script" option and 'deploy' the project, i get a SQL file that uses non-SQL syntax for variables like $database.

How can I execute that deployment script? I'm pretty sure SQL Server management Studio doesn't understand the syntax.

It seems to me the only way to actually deploy, is to swith the option to "Create a deployment script and deploy to the database"

1 Answer 1

8

The script that is generated by Visual Studio is not a standard T-SQL script. It is a SQLCMD script. SQL Server Management Studio does allow you to execute SQLCMD scripts, but by default it is disabled. This link explains more details on SQLCMD mode and how to enable it.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much for this answer... I've been stunbling across the web for over one hour without figuring this one out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.