Generate Scripts is failing

  • On SQL Managed Instance, I'm trying to generate scripts for all objects in the DB. I'm getting an error related to data masking for scripting User defined table type object.

    Can anyone please help me with this.

     

    Microsoft.SqlServer.Management.SqlScriptPublish.SqlScriptPublishException: An error occurred while scripting the objects. ---> Microsoft.SqlServer.Management.Smo.WrongPropertyValueException: Data Masking can be applied only to table columns.at Microsoft.SqlServer.Management.Smo.Column.ScriptDdlCreateImpl(StringBuilder sb, ScriptingPreferences sp)at Microsoft.SqlServer.Management.Smo.Column.ScriptDdl(StringCollection queries, ScriptingPreferences sp)at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ScriptDdlInternal(StringCollection query, ScriptingPreferences sp)at Microsoft.SqlServer.Management.Smo.UserDefinedTableType.ScriptCreate(StringCollection query, ScriptingPreferences sp)at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ScriptCreateInternal(StringCollection query, ScriptingPreferences sp, Boolean skipPropagateScript)at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreateObject(Urn urn, ScriptingPreferences sp, ObjectScriptingType& scriptType)at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreate(Urn urn, ScriptingPreferences sp, ObjectScriptingType& scriptType)at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreateObjects(IEnumerable1 urns)at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptUrns(List1 orderedUrns)at Microsoft.SqlServer.Management.Smo.ScriptMaker.DiscoverOrderScript(IEnumerable1 urns)at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptWorker(List1 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)

  • Can't help you with it. Are you using the latest SSMS?

  • Break it into smaller pieces.  Do the tables, procs, functions, etc.

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply