title: Getting the list of objects from 'db' - Error - Management Studio error while generating Scripts
body: <p>I tried to generate Scripts from our companies Azure SQL-Database. As I did two weeks before I connected to the DB with my Management Studio Client and ran the "Generate Scripts"-Wizard in the Context of the concerned DB. The wizard failed at <strong><em>"Getting the list of objects from 'db'."</em></strong> and pointed out the following Stack Trace:</p>
  
  <p>Microsoft.SqlServer.Management.SqlScriptPublish.SqlScriptPublishException: An error occurred while scripting the objects. ---> System.InvalidCastException: Die angegebene Umwandlung ist ungültig. at Microsoft.SqlServer.Management.Smo.Table.Microsoft.SqlServer.Management.Smo.IPropertyDataDispatch.SetPropertyValue(Int32 index, Object value) at Microsoft.SqlServer.Management.Smo.PropertyDispatcher.SetValue(Int32 index, Object value) at Microsoft.SqlServer.Management.Smo.PropertyCollection.SetValue(Int32 index, Object value) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AddObjectPropsFromDataReader(IDataReader reader, Boolean skipIfDirty, Int32 startColIdx, Int32 endColIdx) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ImplInitialize(String[] fields, OrderBy[] orderby) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.OnPropertyMissing(String propname, Boolean useDefaultValue) at Microsoft.SqlServer.Management.Smo.PropertyCollection.RetrieveProperty(Int32 index, Boolean useDefaultOnMissingValue) at Microsoft.SqlServer.Management.Smo.PropertyCollection.GetPropertyObject(Int32 index) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetPropertyOptional(String propName) at Microsoft.SqlServer.Management.Smo.Column.EmbedDefaultConstraints() at Microsoft.SqlServer.Management.Smo.Column.GetPropagateInfo(PropagateAction action) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetPropagateInfoForDiscovery(PropagateAction action) at Microsoft.SqlServer.Management.Smo.SmoDependencyDiscoverer.GetScriptableChildren(List<code>1 propInfoList, PropagateAction propagateAction) 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</code>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>
  
  <p>The @@VERSION-Query returns the following record:</p>
  
  <p>Microsoft SQL Azure (RTM) - 11.0.9231.13
      Jul 15 2015 11:58:32
      Copyright (c) Microsoft Corporation</p>
  
  <p>And here is some additional information copied from the SSMS-Help:</p>
  
  <p>Microsoft SQL Server Management Studio                        12.0.4100.1
  Microsoft Analysis Services Client Tools                        12.0.4100.1
  Microsoft Data Access Components (MDAC)                        6.1.7601.17514
  Microsoft MSXML                        3.0 6.0
  Microsoft Internet Explorer                        9.11.9600.17843
  Microsoft .NET Framework                        4.0.30319.42000
  Operating System                        6.1.7601</p>
  
  <p>Can you tell me what's going wrong here?</p>
  
  <p>Thanks in Advance.</p>
  
  <p>Alan</p>