Playing around with DB projects, Visual Studio generated a change script with the following lines:
GO
SET ANSI_NULLS, ANSI_PADDING --etc.;
SET NUMERIC_ROUNDABORT OFF;
GO
:setvar DatabaseName "Foo"
:setvar DefaultFilePrefix "Foo"
:setvar DefaultDataPath ""
:setvar DefaultLogPath ""
GO
:on error exit
GO
:setvar __IsSqlCmdEnabled "True"
GO
IF N'$(__IsSqlCmdEnabled)' NOT LIKE N'True'
BEGIN
PRINT N'SQLCMD mode must be enabled to successfully execute this script.';
SET NOEXEC ON;
END
GO
USE [$(DatabaseName)];
GO
CREATE NONCLUSTERED INDEX [SomeIndex]
ON [dbo].[SomeTable]([SomeColumn] ASC);
GO
What is the significance of the colons at the beginning of the lines? This Stackoverflow question says that the colon is for bind variables, but then what does the colon in :on error exit
do?