简体   繁体   English

Visual Studio数据库项目在本地计算机上生成,但在生成服务器上失败

[英]Visual Studio database project builds on local machine, but fails on build server

I'm trying to set up CI for a database project of mine, but am running into an issue that is stumping me. 我正在尝试为我的数据库项目设置CI,但遇到一个困扰我的问题。 I'm able to build the project successfully on my machine; 我可以在我的机器上成功构建项目; however, when I check in my changes to TFS and my build server attempts to build the project, I get errors for nearly every table and view that exists that look like the following: 但是,当我签入对TFS的更改并且构建服务器尝试构建项目时,几乎所有存在的表和视图都出现错误,如下所示:

Phase 1 - 11187 error(s), 556 warning(s)
SAS\dbo\Tables\CohortEntry.sql(12):SAS\dbo\Tables\CohortEntry.sql(12,1): Error SQL70001: This statement is not recognized in this context.
SAS\dbo\Tables\CohortEntry.sql(14):SAS\dbo\Tables\CohortEntry.sql(14,1): Error SQL70001: This statement is not recognized in this context.
SAS\dbo\Tables\CohortEntry.sql(16):SAS\dbo\Tables\CohortEntry.sql(16,1): Error SQL70001: This statement is not recognized in this context.
SAS\dbo\Tables\CohortEntry.sql(18):SAS\dbo\Tables\CohortEntry.sql(18,1): Error SQL70001: This statement is not recognized in this context.
SAS\dbo\Tables\CohortEntry.sql(20):SAS\dbo\Tables\CohortEntry.sql(20,1): Error SQL70001: This statement is not recognized in this context.
SAS\dbo\Tables\CohortEntry.sql(22):SAS\dbo\Tables\CohortEntry.sql(22,1): Error SQL70001: This statement is not recognized in this context.
SAS\dbo\Tables\CohortEntry.sql(24):SAS\dbo\Tables\CohortEntry.sql(24,1): Error SQL70001: This statement is not recognized in this context.
SAS\dbo\Tables\CohortEntry.sql(26):SAS\dbo\Tables\CohortEntry.sql(26,1): Error SQL70001: This statement is not recognized in this context.
SAS\dbo\Tables\CohortEntry.sql(28):SAS\dbo\Tables\CohortEntry.sql(28,1): Error SQL70001: This statement is not recognized in this context.
SAS\dbo\Tables\CohortEntry.sql(30):SAS\dbo\Tables\CohortEntry.sql(30,1): Error SQL70001: This statement is not recognized in this context.
SAS\dbo\Tables\CohortEntry.sql(32):SAS\dbo\Tables\CohortEntry.sql(32,1): Error SQL70001: This statement is not recognized in this context.

The code within this specific file that is failing is: 该特定文件中失败的代码是:

CREATE TABLE [dbo].[CohortEntry] (
    [idCohortEntry] INT           IDENTITY (1, 1) NOT NULL,
    [CohortEntry]   NVARCHAR (50) NULL,
    [CohortLevel]   NVARCHAR (1)  CONSTRAINT [DF_CohortEntry_CohortLevel] DEFAULT (N'S') NOT NULL,
    [CohortCode]    NVARCHAR (3)  NOT NULL,
    CONSTRAINT [PK_CohortEntry] PRIMARY KEY CLUSTERED ([idCohortEntry] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_DefaultView', @value = 2, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Contains one entry for every cohort of Students or Requests described by the SAS.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Filter', @value = NULL, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_OrderBy', @value = NULL, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_OrderByOn', @value = 0, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Orientation', @value = 0, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_TableMaxRecords', @value = 10000, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnHidden', @value = 0, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'idCohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnOrder', @value = 0, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'idCohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnWidth', @value = -1, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'idCohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'A unique serial key.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'idCohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnHidden', @value = 0, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnOrder', @value = 0, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnWidth', @value = 1815, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'A description for this cohort entry.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortEntry';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnHidden', @value = 0, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortLevel';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnOrder', @value = 0, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortLevel';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnWidth', @value = -1, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortLevel';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'A flag indicating whether this cohort entry refers to Student (S) or Request (R) cohorts.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortLevel';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnHidden', @value = 0, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortCode';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnOrder', @value = 0, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortCode';


GO
EXECUTE sp_addextendedproperty @name = N'MS_ColumnWidth', @value = -1, @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortCode';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The unique three-character code that defines this cohort.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CohortEntry', @level2type = N'COLUMN', @level2name = N'CohortCode';

I'm not really sure where the issue lies - any assistance would be much appreciated. 我不太确定问题出在哪里-任何帮助将不胜感激。

I actually ended up figuring it out, partially from the earlier attached link. 实际上,我最终从部分先前的链接中找出来了。 It looks like all of the SQL files that were causing an error were missing the GO flow operator at the end of the file - this seems to be required after every EXECUTE command, even at the end of the file. 看起来所有导致错误的SQL文件在文件末尾都缺少GO流运算符-这似乎在每个EXECUTE命令之后都需要,甚至在文件末尾也是如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2010 - 导入数据库的数据库项目无法构建 - Visual Studio 2010 - Database Project with imported database fails to build Visual Studio 2013 SQL Server数据库项目构建失败 - Visual Studio 2013 SQL Server database project build failure 建立连接到SQL Server的Visual Studio项目? - Build Visual Studio Project that connects to SQL Server? 在 Visual Studio 中从服务器数据库创建本地数据库 - Creating a local database from server database in visual studio Visual Studio数据库项目+部署+ TFS构建+多租户 - Visual Studio Database Project + Deploy + TFS Build + Multi Tenancy 从 Visual Studio 2013 数据库项目中清理 SQL Server 数据库 - Clean SQL Server database from Visual Studio 2013 database project 使用链接服务器数据库参考的Visual Studio数据库项目 - Visual Studio Database Project using linked server database reference 无法从Visual Studio连接本地数据库服务器 - Unable to connect local database server from visual studio 应用程序页面在Visual Studio中将数据插入本地SQL Server数据库 - Application Page Inserting data into local SQL Server database in Visual Studio 在Mac的Visual Studio中连接到本地SQL Server数据库 - Connecting to local SQL Server database in visual studio for mac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM