microsoft / microsoft/sqlmanagementobjects

Replace some SMO enumerations with string constants

Open
#102 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
143
Forks
28
PR merge metrics
No merged PRs in 30d

Description

One source of continuous maintenance in SMO is adding new enumeration values as Azure SQL Database and SQL Server evolve over time.
Unless we update the enumerations SMO is unable to generate scripts for objects that use the new values. For the most part, there's very little value in having an enumeration for these identifiers instead of string constants. SMO should be able to store any value returned from the server and use it in script generation without converting it from string to enum value. We can continue to facilitate C# programming by replacing the enumerations with static classes of string constants that have C#-style names for the values SMO knows about.

Here's an incomplete list of candidate enumerations to replace with strings in the next major version bump:

ExternalDataSourceType
ExternalFileFormatType
ExternalStreamingJobStatusType
ExternalTableRejectType
DwTableDistributionType
DwViewDistributionType
ExternalLanguageFilePlatform
AuditDestinationType
OnFailureAction
SensitivityRank
AuditActionType
DatabaseScopedConfigurationOnOff
TemporalHistoryRetentionPeriodUnit
DataRetentionPeriodUnit
CatalogCollationType
AgentSubSystem
JobExecutionStatus

Another enum that needs some re-design to allow SSMS to support new permission values without a SMO update is DatabasePermissionSetValue

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the declarations and usages of the candidate enumerations listed in the issue, including ExternalDataSourceType, AuditActionType, and DatabasePermissionSetValue. Determine the required redesign and its impact on SMO and SSMS support before proposing scope; done would mean the selected values can accept new server-returned identifiers without a SMO update.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, sql
Domain
database
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.