sql-server – 从Azure SQL数据库生成SQL脚本

当我尝试从Azure数据库生成SQL Server Management Studio 2012中的脚本时.我收到以下错误:

Microsoft.SqlServer.Management.SqlScriptPublish.SqlScriptPublishException:
An error occurred while scripting the objects. —>
Microsoft.SqlServer.Management.Sdk.Sfc.EnumeratorException: Failed to
retrieve data for this request. —>
Microsoft.SqlServer.Management.Sdk.Sfc.InvalidVersionEnumeratorException:
Operation not supported on version 11.0 SqlAzureDatabase. at
Microsoft.SqlServer.Management.Smo.XmlReadDoc.LoadFile(Assembly a,
String strFile) at
Microsoft.SqlServer.Management.Smo.SqlObject.LoadInitData(String file,
ServerVersion ver, DatabaseEngineType databaseEngineType) at
Microsoft.SqlServer.Management.Sdk.Sfc.ObjectCache.LoadElement(ObjectLoadInfo
oli, ServerVersion ver, DatabaseEngineType databaseEngineType) at
Microsoft.SqlServer.Management.Sdk.Sfc.ObjectCache.GetElement(ObjectLoadInfo
oli, ServerVersion ver, DatabaseEngineType databaseEngineType) at
Microsoft.SqlServer.Management.Sdk.Sfc.ObjectCache.GetAllElements(Urn
urn, ServerVersion ver, DatabaseEngineType databaseEngineType, Object
ci) at
Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetObjectsFromCache(Urn
urn, Object ci) at
Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData(Request
req, Object ci) at
Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object
connectionInfo, Request request) at
Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object
connectionInfo, Request request) — End of inner exception stack
trace — at
Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object
connectionInfo, Request request) at
Microsoft.SqlServer.Management.Smo.ExecutionManager.GetEnumeratorData(Request
req) at
Microsoft.SqlServer.Management.Smo.Server.GetLCIDCollation(String
collationName) at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetComparerFromCollation(String
collationName) at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean
inServer) at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()
at Microsoft.SqlServer.Management.Smo.Database.PreInitChildLevel() at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitChildLevel(Urn
levelFilter, ScriptingPreferences sp, Boolean forScripting) at
Microsoft.SqlServer.Management.Smo.DatabasePrefetchBase.InitializeObjectCollection(String
type) at
Microsoft.SqlServer.Management.Smo.DatabasePrefetchBase.d__1.MoveNext()
at
Microsoft.SqlServer.Management.Smo.SmoDependencyDiscoverer.SfcChildrenDiscovery(HashSet1
discoveredUrns) at
Microsoft.SqlServer.Management.Smo.SmoDependencyDiscoverer.Discover(IEnumerable
1
urns) at
Microsoft.SqlServer.Management.Smo.ScriptMaker.Discover(IEnumerable1
urns) at
Microsoft.SqlServer.Management.Smo.ScriptMaker.DiscoverOrderScript(IEnumerable
1
urns) at
Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptWorker(List`1
urns, ISmoScriptWriter writer) at
Microsoft.SqlServer.Management.Smo.ScriptMaker.Script(Urn[] urns,
ISmoScriptWriter writer) at
Microsoft.SqlServer.Management.SqlScriptPublish.SqlScriptGenerator.DoScript(ScriptOutputOptions
outputOptions) — End of inner exception stack trace — at
Microsoft.SqlServer.Management.SqlScriptPublish.GeneratePublishPage.worker_DoWork(Object
sender, DoWorkEventArgs e) at
System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at
System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object
argument)

我找到了这个帖子:Failed to generate scripts for Sql Azure database: “Getting the list of objects from : failed”
但我无法使用:http://cloudservices.red-gate.com/

最佳答案 尝试使用能够与Azure一起使用的SQL Server第三方工具.我认为来自Red-Gate的SQL Compare能够使用SQL Azure但我并不是百分之百确定.您始终可以在试用模式下使用它来完成工作……

点赞