2015-11-20 43 views
0

当我发布包含多个文件组和文件的新数据库时,文件组在创建数据库时不会发布。当数据库正在升级它的工作,这意味着我需要调用sqlpackager.exe两次发布数据库。数据库应用程序没有在创建数据库时部署文件组,只有升级过程

目标: 使用filegroups(共享组件)创建一个数据库,用于分解销售数据中的配置数据。

执行: 主数据库项目引用一个仅包含文件组集合的公用数据库项目。数据库引用已正确设置。用于部署dacpac的发布文件正确设置属性:IgnoreFileGroupPlacement(FALSE) 主数据库项目具有要添加到文件组的文件列表。 我创建了一个名为“defaultworkingspace”的文件组来移除除主系统对象以外的所有内容,我将此文件组标记为默认值。 当我部署的第一次,我得到下面的错误:

Initializing deployment (Start) 
*** A project which specifies SQL Server 2008 as the target platform may experience compatibility issues with SQL Server 2005. 
*** The following SqlCmd variables are not defined in the target scripts: SourceCode SourceId. 
Initializing deployment (Complete) 
Analyzing deployment plan (Start) 
Analyzing deployment plan (Complete) 
Updating database (Start) 
Creating Register_DB... 
An error occurred while the batch was being executed. 
Updating database (Failed) 
*** Could not deploy package. 
Warning SQL0: A project which specifies SQL Server 2008 as the target platform may experience compatibility issues with SQL Server 2005. 
Warning SQL72013: The following SqlCmd variables are not defined in the target scripts: SourceCode SourceId. 
Error SQL72014: .Net SqlClient Data Provider: Msg 5014, Level 16, State 2, Line 1 The filegroup 'DefaultWorkingSpace' does not exist in database 'Register_DB'. 
Error SQL72045: Script execution error. The executed script: 
ALTER DATABASE [$(DatabaseName)] 
    MODIFY FILEGROUP [DefaultWorkingSpace] DEFAULT; 

默认的设置已经被设定为岗位部署脚本的一部分,所以它应该与所有后运行部署脚本。当我现在又部署,作为升级的数据库已经建立

Initializing deployment (Start) 
*** A project which specifies SQL Server 2008 as the target platform may experience compatibility issues with SQL Server 2005. 
*** The following SqlCmd variables are not defined in the target scripts: SourceCode SourceId. 
*** The source's object [Register_DB] is different than the target's version of the object but the target object will not be updated. 
*** The object [Register_DB] already exists in database with a different definition and will not be altered. 
Initializing deployment (Complete) 
Analyzing deployment plan (Start) 
Analyzing deployment plan (Complete) 
Updating database (Start) 
Creating [Configuration]... 
Creating [DefaultWorkingSpace]... 
Creating [Giftcards]... 
Creating [Logging]... 
Creating [MasterData]... 
Creating [Mobile]... 
Creating [Sales]... 
Creating [Config]... 
Creating [Working]... 
Creating [Giftcards]... 
Creating [Logging]... 
Creating [Master]... 
Creating [Sales]... 

这似乎很奇怪的是,升级过程中支持文件组,但初始创建数据库的不......有没有人翻过这问题之前?

回答

0

显然,dacpac的已知问题。

我采用了部署db项目的方法来优先处理并创建数据库,如果它们不存在于该数据库的后脚本中。不是最干净的,但它现在会做。

相关问题