azure-sql-database – 将DACPAC部署到SQL Azure服务器时出错

使用VS2010 SP1数据层应用程序项目,我创建了最简单的数据库:

CREATE TABLE [dbo].[表1]
(
    column_1 int NOT NULL,
    column_2 int NULL
)

然后我成功构建了.dacpac,并通过使用SSMS 2008 R2将其部署到本地SQL Express实例来验证它(一切正常).

然后我尝试使用SSMS 2008 R2将.dacpac部署到SQL Azure服务器.该向导设法完成了每个步骤(包括创建数据库和创建模式),但在最后一步 – “在DAC元数据中注册DAC” – 使用IndexOutOfRangeException(见下文)失败.

我试图对现有的SQL Azure服务器,针对新的SQL Azure服务器(两者都失败并出现相同的异常)以及针对具有相同名称的空数据库的SQL Azure服务器执行此操作(此一个服务器因SSMS运行时异常而失败) ).

我现在已经没想法了.有关如何将.dacpacs部署到SQL Azure的任何想法将不胜感激.

System.IndexOutOfRangeException: Index was outside the bounds of the
array. at
Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNameToIDLookupWithException(String
propertyName, PropertyAccessPurpose pap) at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean
inServer) at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()
at
Microsoft.SqlServer.Management.Smo.AbstractCollectionBase.get_StringComparer()
at
Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCollection()
at
Microsoft.SqlServer.Management.Smo.SmoCollectionBase.get_InternalStorage()
at
Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetObjectByKey(ObjectKeyBase
key) at
Microsoft.SqlServer.Management.Smo.DatabaseCollection.get_Item(String
name) at Microsoft.SqlServer.Management.Dac.RegisterDacStep.Execute()
at
Microsoft.SqlServer.Management.Dac.TransactionalActionManager.ManagedActionStep.TransactionalStep.DoExecute()
at
Microsoft.SqlServer.Management.Dac.TransactionalActionManager.ManagedActionStep.Execute()
at
Microsoft.SqlServer.Management.Dac.TransactionalActionManager.ExecuteActionSteps(IEnumerable`1
managedActionSteps) at
Microsoft.SqlServer.Management.Dac.TransactionalActionManager.Go() at
Microsoft.SqlServer.Management.Dac.DacStore.Install(DacType dacType,
DatabaseDeploymentProperties deploymentProperties, Boolean
skipPolicyValidation, Boolean skipDacRegistration)

最佳答案 你有SSMS的最新版本吗?您应该运行SSMS R2 SP1.它具体针对DAC PAC进行了修复.

这是:http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=26727

点赞