2
我已經在工作中受到了Visual Studio 2012 Premium的祝福。我給出的一個任務是在開發和系統測試數據庫之間進行模式比較。這是一切都很好,但是當我生成腳本交給遷移團隊,我得到這個在標題:導出架構比較升級腳本到transact-sql with visual studio 2012 premium
/*
Deployment script for MyGloriousDatabase
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
:setvar DatabaseName "MyGloriousDatabase"
:setvar DefaultFilePrefix "MyGloriousDatabase"
:setvar DefaultDataPath "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\"
:setvar DefaultLogPath "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\"
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)];
...
現在,就不難修剪此並將其製作成.sql腳本,您可以簡單地在SSMS中運行。但是我看到以前版本的Visual Studio有一個「導出到Transact-SQL」選項。這個選項隱藏在2012年嗎?我能找到的最好的選擇是評論SQLCMD行。
謝謝!