title: Generate SQL scripts from Azure SQL Database
body: <p>When I tried to Generate scripts in <code>SQL Server Management Studio 2012</code> from my <code>Azure</code> database. I received following error:</p>
  
  <blockquote>
    <p>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(HashSet<code>1
    discoveredUrns) at
    Microsoft.SqlServer.Management.Smo.SmoDependencyDiscoverer.Discover(IEnumerable</code>1
    urns) at
    Microsoft.SqlServer.Management.Smo.ScriptMaker.Discover(IEnumerable<code>1
    urns) at
    Microsoft.SqlServer.Management.Smo.ScriptMaker.DiscoverOrderScript(IEnumerable</code>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)</p>
  </blockquote>
  
  <p>I found this thread: <a href="https://stackoverflow.com/questions/12712531/failed-to-generate-scripts-for-sql-azure-database-getting-the-list-of-objects">Failed to generate scripts for Sql Azure database: &quot;Getting the list of objects from : failed&quot;</a>
  but I cannot use: <code>http://cloudservices.red-gate.com/</code></p>