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 "Getting the list of objects from 'db'." and pointed out the following Stack Trace:
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(List1 propInfoList, PropagateAction propagateAction) at Microsoft.SqlServer.Management.Smo.SmoDependencyDiscoverer.SfcChildrenDiscovery(HashSet
1 discoveredUrns) at Microsoft.SqlServer.Management.Smo.SmoDependencyDiscoverer.Discover(IEnumerable1 urns) at Microsoft.SqlServer.Management.Smo.ScriptMaker.Discover(IEnumerable
1 urns) at Microsoft.SqlServer.Management.Smo.ScriptMaker.DiscoverOrderScript(IEnumerable1 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)
The @@VERSION-Query returns the following record:
Microsoft SQL Azure (RTM) - 11.0.9231.13 Jul 15 2015 11:58:32 Copyright (c) Microsoft Corporation
And here is some additional information copied from the SSMS-Help:
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
Can you tell me what's going wrong here?
Thanks in Advance.
Alan
I had the same problem . To resolve I switched to another directory that sql server could write .
Worked for me.
I hope you solve your problem , since the error message is not clear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With