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 }}
Repository navigation
Extended properties not supported on Azure Sql? Is there a plan to support? #178
Im using SMO to generate a database and related objects on an Azure Sql server (fully hosted not a VM or Sql Managed Instance). I can generate objects such as tables, indexes, stored procedures and views but I cannot create extended properties associated with these objects. This works perfectly on my local sql server. As a result of this problem I have had to add my own extended property script generators which has exploded the code base. Any plans to correct this in the future?
Double check how you set your scripting options. I enable "Script extended properties" in SSMS in "Tools/Options/SQL Server Object Explorer/Scripting" and when I "Script Table As Create" in OE it includes EP scripts
I can cross script from SQL Server to Azure SQL Database too, and it includes EPs
Im using the SMO objects in code only, not in SSMS or Azure Data Studio. There is an inconsistent deployment of extended properties for different objects. For tables it will create the extended properties but for other objects like views, stored procedures, indexes it does not create them. Ill investigate the options you mention above and see if that makes a difference.
I have managed to get this to work by executing the SMO extended property after I create the object. This is different behaviour from tables that create the extended properties at the same time as table creation.
Eg.
//create SMO procedure in code not shown
var smoProperty = new SMOProperty(smoProcedure, "InstanceId", asset.InstanceId.ToString());
smoProcedure.ExtendedProperties.Add(smoProperty);
//does not create EP
smoProcedure.Create();
//have to run this to create EP
smoProperty.Create();
I see. I misread the original issue to mean you were trying to generate scripts from an existing database.
It's a weird difference in behavior. At this point, though, it's probably more risky to fix it than to leave it as-is. There are probably other apps that directly or indirectly depend on the current behavior.
Activity
shueybubbles commentedon Oct 31, 2024
Double check how you set your scripting options. I enable "Script extended properties" in SSMS in "Tools/Options/SQL Server Object Explorer/Scripting" and when I "Script Table As Create" in OE it includes EP scripts
I can cross script from SQL Server to Azure SQL Database too, and it includes EPs
ScottyTarvan commentedon Nov 4, 2024
Im using the SMO objects in code only, not in SSMS or Azure Data Studio. There is an inconsistent deployment of extended properties for different objects. For tables it will create the extended properties but for other objects like views, stored procedures, indexes it does not create them. Ill investigate the options you mention above and see if that makes a difference.
ScottyTarvan commentedon Nov 4, 2024
I have managed to get this to work by executing the SMO extended property after I create the object. This is different behaviour from tables that create the extended properties at the same time as table creation.
Eg.
shueybubbles commentedon Nov 4, 2024
I see. I misread the original issue to mean you were trying to generate scripts from an existing database.
It's a weird difference in behavior. At this point, though, it's probably more risky to fix it than to leave it as-is. There are probably other apps that directly or indirectly depend on the current behavior.