我的问题是关于SQL模式比较。
当我使用SQL模式比较生成脚本时,脚本以以下格式生成。
/*
Deployment script for Student
This code was generated by a tool.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
*/
GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
GO
:setvar DatabaseName "Student"
:setvar DefaultFilePrefix "Student"
:setvar DefaultDataPath "F:\Data\"
:setvar DefaultLogPath "H:\Logs\"
GO
:on error exit
GO
/*
Detect SQLCMD mode and disable script execution if SQLCMD mode is not supported.
To re-enable the script after enabling SQLCMD mode, execute the following:
SET NOEXEC OFF;
*/
: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
PRINT N'Altering [dbo].[usp_InsertStudentData]...';
GO
.....
如果我在SQL Cmd模式下运行以下查询,则假定它可以运行。
但是我不想在SQL Cmd模式下运行此查询,因为我们的dba不赞成这样做 现在我的问题是...
我需要执行不包含SQL命令模式代码“:setvar DatabaseName”的脚本
让我知道您是否在我的问题上需要更多帮助。