You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 7, 2024. It is now read-only.
Microsoft.SqlServer.Management.Smo.PropertyCannotBeRetrievedException: Property RangeType is not available for PhysicalPartition '1'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.
#277
I have an Azure Synapse Analytics Dedicated SQL Pool with over 10,000 tables in it and this tool has been super helpful to generate CREATE TABLE scripts for many of the tables.
Unfortunately, I'm getting the error in the subject line on numerous tables.
Scripting request: db64578d-07d2-4cf4-9b1b-ca73948d07ca encountered error: An error occurred while scripting the objects.
Error details: Microsoft.SqlServer.Management.SqlScriptPublish.SqlScriptPublishException:
An error occurred while scripting the objects. ---> Microsoft.SqlServer.Management.Smo.PropertyCannotBeRetrievedException:
Property RangeType is not available for PhysicalPartition '1'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.
at Microsoft.SqlServer.Management.Smo.PropertyCollection.HandleNullValue(Int32 index)
at Microsoft.SqlServer.Management.Smo.PropertyCollection.GetPropertyObject(Int32 index)
at Microsoft.SqlServer.Management.Smo.Table.ProcessSqlDwTableProperties(StringBuilder script, ScriptingPreferences sp)
at Microsoft.SqlServer.Management.Smo.Table.GetSqlDwTableCreationScript(ScriptingPreferences sp, StringBuilder sb)
at Microsoft.SqlServer.Management.Smo.Table.ScriptCreate(StringCollection queries, 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(IEnumerable`1 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.SqlScriptPublish.SqlScriptGenerator.DoScript(ScriptOutputOptions outputOptions)
--- End of inner exception stack trace ---
at Microsoft.SqlServer.Management.SqlScriptPublish.SqlScriptGenerator.DoScript(ScriptOutputOptions outputOptions)
at Microsoft.SqlTools.ServiceLayer.Scripting.ScriptingScriptOperation.Execute() in D:\repos\sqltoolsservice\src\Microsoft.SqlTools.ServiceLayer\Scripting\ScriptingScriptOperation.cs:line 64
I'm using the admin account in the command and when I use SSMS to generate the create table script, it works fine:
/****** Object: Table [mySchema].[myTable] Script Date: 3/2/2023 2:39:28 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [mySchema].[myTable]
(
[ID] [int] NOT NULL,
[NM] [varchar](30) NOT NULL,
[DTS] [datetime2](7) NOT NULL,
[column1] [numeric](38, 2) NULL,
[column2] [nvarchar](255) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX,
PARTITION
(
[column1] RANGE FOR VALUES ()
)
)
GO
Any ideas on how to get around this? It is happening often enough that I'd love to get this fully scripted.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have an Azure Synapse Analytics Dedicated SQL Pool with over 10,000 tables in it and this tool has been super helpful to generate CREATE TABLE scripts for many of the tables.
Unfortunately, I'm getting the error in the subject line on numerous tables.
Here is the command I'm running:
mssql-scripter -S "server" -d "database" -U "$UserName" -P "password" --target-server-version AzureDW --script-create --include-objects "Schema.Table"
The error I get for some tables is:
I'm using the admin account in the command and when I use SSMS to generate the create table script, it works fine:
Any ideas on how to get around this? It is happening often enough that I'd love to get this fully scripted.
The text was updated successfully, but these errors were encountered: