Jennifersmith23

I am trying to deploy a database that was built through VSTS DBPro (I am still on CTP7) and it errors when it tries to set the database name variable. Can anyone offer any insight

The first few lines of code:

SET ARITHABORT, CONCAT_NULL_YIELDS_NULL, ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, QUOTED_IDENTIFIER ON

SET NUMERIC_ROUNDABORT OFF

GO

:setvar databasename "ERSP"

USE [master]

GO

:on error exit

Which throws the error:

Msg 102, Level 15, State 1, Line 4

Incorrect syntax near ':'.

Msg 102, Level 15, State 1, Line 2

Incorrect syntax near ':'.

Msg 50000, Level 16, State 127, Line 5

The database name in the build script $(databasename) does not match the name of the target database ERSP. Verify whether your database project settings are correct and whether your build script is up to date.

Msg 50000, Level 16, State 127, Line 9

The database compatibility level of the build script 90 does not match the compatibility level of the target database (null). Verify whether your database project settings are correct and whether your build script is up to date.

Msg 102, Level 15, State 1, Line 3

Incorrect syntax near ':'.

Msg 911, Level 16, State 1, Line 1

Could not locate entry in sysdatabases for database '$(databasename)'. No entry found with that name. Make sure that the name is entered correctly.




Re: Visual Studio Team System - Database Professionals Problem with New Database Deployment

tomsmi - MSFT

Are you deploying via the Deploy command in the project in Visual Studio Or trying to run the build script through an external source (Query analyzer, SSMS, etc)

If you are running the build script, make sure that SQLCMD Mode is turned on when you do (in SSMS, you can do this via the Query menu).

Hope this helps,

-Tom






Re: Visual Studio Team System - Database Professionals Problem with New Database Deployment

StevenPo - MSFT

Jennifer -

Are you still blocked by this issue If so, please provide the additional information that Tom requested and we'll see if we can get you unblocked.

thanks,






Re: Visual Studio Team System - Database Professionals Problem with New Database Deployment

Jennifersmith23

I did not have the SQLCMD mode turned on...I discovered that just after I posted this message and all is working now. Thank you for checking.