Skip to content

Commit 74e1ae6

Browse files
authored
Sync to 161.48036.0 (#125)
* sync 161.48036.0 * use latest sqlparser
1 parent f779105 commit 74e1ae6

File tree

1,239 files changed

+4570
-2577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,239 files changed

+4570
-2577
lines changed

.editorconfig

+15-15
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ indent_style = space
77
# (Please don't specify an indent_size here; that has too many unintended consequences.)
88

99
# IDE0073: File header
10-
file_header_template = Copyright (c) Microsoft.\nLicensed under the MIT license.
10+
file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT license.
1111

1212
# Code files
1313
[*.{cs, sql}]
@@ -25,20 +25,20 @@ dotnet_separate_import_directive_groups = false
2525
dotnet_sort_system_directives_first = true
2626

2727
# Avoid "this." if not necessary
28-
dotnet_style_qualification_for_field = false:silent
29-
dotnet_style_qualification_for_property = false:silent
30-
dotnet_style_qualification_for_method = false:silent
31-
dotnet_style_qualification_for_event = false:silent
28+
dotnet_style_qualification_for_field = false:suggestion
29+
dotnet_style_qualification_for_property = false:suggestion
30+
dotnet_style_qualification_for_method = false:suggestion
31+
dotnet_style_qualification_for_event = false:suggestion
3232

3333
# Use language keywords instead of framework type names for type references
3434
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
3535
dotnet_style_predefined_type_for_member_access = true:suggestion
3636

3737
# Parentheses preferences
38-
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
39-
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
40-
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
41-
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
38+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
39+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
40+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
41+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
4242

4343
# Modifier preferences
4444
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
@@ -55,10 +55,10 @@ dotnet_style_collection_initializer = true:suggestion
5555
dotnet_style_explicit_tuple_names = true:suggestion
5656
dotnet_style_null_propagation = true:suggestion
5757
dotnet_style_object_initializer = true:suggestion
58-
dotnet_style_prefer_auto_properties = true:silent
58+
dotnet_style_prefer_auto_properties = true:suggestion
5959
dotnet_style_prefer_compound_assignment = true:suggestion
60-
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
61-
dotnet_style_prefer_conditional_expression_over_return = true:silent
60+
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
61+
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
6262
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
6363
dotnet_style_prefer_inferred_tuple_names = true:suggestion
6464
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
@@ -89,7 +89,7 @@ csharp_style_conditional_delegate_call = true:suggestion
8989

9090
# Modifier preferences
9191
csharp_prefer_static_local_function = true:suggestion
92-
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
92+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
9393

9494
# Code-block preferences
9595
csharp_prefer_braces = when_multiline:suggestion
@@ -104,10 +104,10 @@ csharp_style_pattern_local_over_anonymous_function = true:suggestion
104104
csharp_style_prefer_index_operator = true:suggestion
105105
csharp_style_prefer_range_operator = true:suggestion
106106
csharp_style_throw_expression = true:suggestion
107-
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
107+
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
108108

109109
# 'using' directive preferences
110-
csharp_using_directive_placement = outside_namespace:silent
110+
csharp_using_directive_placement = outside_namespace:suggestion
111111

112112
#### C# Formatting Rules ####
113113

CHANGELOG.md

+189
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# Change log
2+
3+
Update this document for internal externally visible changes. Put most recent changes first.
4+
Once we push a new version to nuget.org add a double hash header for that version.
5+
6+
- Add initial replication of contained AG system databases to AG creation
7+
- Upgrade VSTest to 17.4.1 to remove workaround for unit test builds
8+
- Fix Databases collection not to login to each database when app asks for `Status` property
9+
- Enable datetime masked columns
10+
- Update product display names
11+
- Add database, server, and object permissions for SQL Server 2019 and SQL Server 2022
12+
13+
## 161.48028.0
14+
15+
- Add certificate and asymmetric key user support for Azure DB
16+
- Change the name of the XML file used by SSMS 19 to RegSrvr16.xml
17+
18+
## 161.47027.0
19+
20+
- Fix distribution columns on scripting for taking into consideration more than one distribution column
21+
- Add new EXTGOV_OPERATION_GROUP audit action type
22+
- Force [QUOTED_IDENTIFIER ON](https://github.com/microsoft/sqlmanagementobjects/issues/96) for all tables
23+
- Change Databases enumeration on Azure DB to ignore `sys.databases` entries that don't have an entry in `sys.database_service_objectives`. Prevents attempted logins to user databases when enumerating databases on the logical master
24+
- Update permissions enumeration for SQL Server 2022
25+
26+
## 161.47021.0
27+
28+
- Add `LedgerViewSchema` property to table objects
29+
- Fix an issue that caused ledger tables with views with different schemas to be scripted improperly
30+
- Added support for `Contained Availability Groups`: new AvailabilityGroup.IsContained and AvailabilityGroup.ReuseSystemDatabases properties and updated Create() method.
31+
- Fixed generate scripts test for SQL 2012
32+
- Added automated tests for `JobServer` methods
33+
- Marked several `JobServer` methods supporting SQL 2005 and earlier as Obsolete
34+
- Marked unused property `JobServerFilter.OldestFirst` as Obsolete
35+
- Add `IsDroppedLedgerTable` and `IsDroppedLedgerView` properties to table and view objects, respectively
36+
- Add `IsDroppedLedgerColumn` properties to column, and updated scripting to not include dropped ledger columns in script creation
37+
- Fixed heuristic in [Wmi.ManagedComputer](https://github.com/microsoft/sqlmanagementobjects/issues/83) to determine the correct WMI namespace to connect to,
38+
to workaround a bug where SQL Setup setup does not fully uninstall the SQL WMI Provider.
39+
- Update `ConnectionManager.InternalConnect` to retry connection in response to error 42109 (serverless instance is waking up)
40+
41+
## 161.47008.0
42+
43+
- Fix an issue that caused `ServerConnection.SqlExecutionModes` property to be set to `ExecuteSql` during lazy property fetches of SMO objects despite being set to `CaptureSql` by the calling application.
44+
- Add `LoginType` property to `ILoginOptions` interface.
45+
- `Login.PasswordPolicyEnforced` now returns `false` for Windows logins instead of throwing an exception
46+
- Remove net461 binaries from nuget packages
47+
- Added Scripting Support for Ledger tables for SQL 2022+
48+
- Change the `Size` property on `Server/Drive` objects to `System.Int64`. These objects don't have a C# wrapper class so it's not breaking any compilation.
49+
- Add support for SQL Server version 16
50+
- Add new permissions for SQL 2019+ to SMO enumerations
51+
- Added External Stream object and External Streaming Jobs object for scripting
52+
- Add support for XML compression
53+
54+
## 161.46521.71
55+
56+
- Handle Dedicated SQL Pool login error 110003 during enumerate of Databases
57+
- Enable asymmetric and symmetric key objects for dedicated SQL Pool database
58+
- Fix Tables enumeration on Azure SQL Database instances using a case sensitive catalog collation
59+
- Fix scripting of [hidden columns](https://github.com/microsoft/sqlmanagementobjects/issues/65)
60+
- Enable Generate Scripts to script temporal tables when the destination is a pre-2016 version of SQL Server. System versioning DDL will be omitted from the generated script.
61+
62+
## 161.46437.65
63+
64+
- Update Microsoft.Data.SqlClient dependency to version 3.0.0
65+
- Added Scripting Support for Ledger table in Azure SQLDB
66+
- Change `Server.MasterDBPath` and `Server.MasterDBLogPath` properties to use `file_id` instead of `name` from `sys.database_files`
67+
- Enable Index creation for memory optimized tables in Azure
68+
- Fix Server/Logins to show external Logins for Azure SQLDB as they are now supported
69+
- Split SmoMetadataProvider into its own nuget packages
70+
- Adding support for External Languages
71+
72+
## 161.46347.54
73+
74+
- Add Microsoft.SqlServer.SqlWmiManagement and Microsoft.SqlServer.Management.Smo.Wmi to lib\netcoreapp3.1
75+
- Add missing resource files for netcoreapp3.1 and netstandard2.0
76+
- Fix an [issue](https://github.com/microsoft/sqlmanagementobjects/issues/50) with scripting Azure Synapse Analytics databases
77+
- Add missing values to AuditActionType enum
78+
- Fixed an issue where AffinityInfo.Alter() may throw an error like `An item with the same key has already been added` when
79+
trying to update the AffinityMask of a specific CPU, particularly on machines with Soft-NUMA.
80+
- Updated formatting logic of Predicate values in XEvent scripts
81+
- Fix for scripting distributed Availability Groups
82+
- Add support for resumable option on create constraints and low priority wait
83+
84+
## 161.46041.41
85+
86+
- Add descriptions to more Facet properties
87+
- Add net461 binaries due to customer demand. Only core scripting functionality is included in lib\net461
88+
- Make RegisteredServersStore.InitializeLocalRegisteredServersStore public to enable loading and saving registered servers in a custom location
89+
- Fixed an [issue](https://github.com/microsoft/sqlmanagementobjects/issues/34)
90+
where the creation of a DataFile may fail when targeting a SQL Azure Managed Instance
91+
- Fix Database.Checkpoint to always checkpoint the correct database. [Issue 32](https://github.com/microsoft/sqlmanagementobjects/issues/32)
92+
93+
## 161.44091.28
94+
95+
- Make ISmoScriptWriter interface public
96+
- Enable apps to provide custom ISmoScriptWriter implementation to SqlScriptPublishModel and ScriptMaker
97+
- Enabled Security Policy while GenerateScript/Transfer database.
98+
- Expose EXTERNAL_MONITOR server audit destination for SQL Managed Instance
99+
- Expose OPERATOR_AUDIT server audit option for SQL Managed Instance
100+
- Change association of DatabaseEngineEdition.SqlOnDemand to DatabaseEngineType.SqlAzureDatabase
101+
- Fix implementation of Microsoft.SqlServer.Management.HadrModel.FailoverTask.Perform to handle AvailabilityGroupClusterType.None correctly
102+
103+
## 161.42121.15
104+
105+
- Add netcoreapp3.1 build output
106+
- Fix [logins using impersonation](https://github.com/microsoft/sqlmanagementobjects/issues/24)
107+
- Expose OlapConnectionInfo class in non-netfx ConnectionInfo
108+
- Expose WmiMgmtScopeConnection in non-netfx ConnectionInfo
109+
110+
## 161.41981.14
111+
112+
- Add Accelerated Database Recovery support - <https://github.com/microsoft/sqlmanagementobjects/issues/22>
113+
- Enable Column.BindDefault on Azure SQL Database
114+
- Add DestinationServerConnection property to Transfer
115+
- [Github issue 16](https://github.com/microsoft/sqlmanagementobjects/issues/16)
116+
- Allows for use of Azure SQL Database as a destination server
117+
- Enables full customization of the destination connection
118+
- [Script User objects for Azure SQL Database correctly](https://github.com/microsoft/sqlmanagementobjects/issues/18)
119+
- [Enable CreateOrAlter behavior for Scripter](https://github.com/microsoft/sqlmanagementobjects/issues/11)
120+
- Fixed issue where MaxSize value was reported as negative for Hyperscale Azure SQL Databases - Added new property "IsMaxSizeApplicable" and disabled negative values for Hyperscale Azure SQL Databases.
121+
122+
## 161.41011.9
123+
124+
- Put begin try/begin catch around TSQL querying sys.database_service_objectives in Azure SQL Database. This view may throw if Azure control plane has an outage and block expansion of the Databases node in SSMS.
125+
- Add support for Workload Management Workload Classifiers.
126+
- Add support for Workload Management Workload Groups.
127+
- Handle SQL error code 4060 during fetch of Database.DatabaseEngineEdition and use default value of Unknown
128+
- Update Microsoft.Data.SqlClient dependency to version 2.0.0
129+
- Update the Nuget package major version to 161 to reflect the shift to Microsoft.Data.SqlClient for NetFx
130+
- Fixed Database.Size property to report the accurate size of the database when
131+
DatabaseEngineType is SqlAzureDatabase
132+
- Fixed issue where Database.SpaceAvailable was reported as negative for Hyperscale Azure SQL Databases
133+
(the value is reported as 0, meaning *Not applicable*)
134+
- Implement IObjectPermission on DatabaseScopedCredential. <https://github.com/microsoft/sqlmanagementobjects/issues/14>
135+
- Enabled Server.EnumServerAttributes API on Azure SQL Database
136+
- Enabled Lock enumeration APIs on Azure SQL Database
137+
- Deleted the Database.CheckIdentityValues API
138+
- Added new property "RequestMaximumMemoryGrantPercentageAsDouble" in WorkloadGroup to accept decimal values in Resource Governor (SQL 2019+).
139+
- Changed the netfx binaries in Microsoft.SqlServer.SqlManagementObjects package to use Microsoft.Data.SqlClient
140+
- Added a new package, Microsoft.SqlServer.SqlManagementObjects.SSMS, which only has netfx binaries and that uses System.Data.SqlClient
141+
- Fixed a scripting issue with statistics on filtered indexes where the filter from the index would be scripted with the UPDATE STATISTICS TSQL.
142+
143+
## 160.2004021.0
144+
145+
- First non-preview 160 release, aligned with [SQL Server Management Studio](https://aka.ms/ssmsfullsetup) 18.5
146+
- Script extended properties for Azure SQL Database objects
147+
- Enable Jupyter Notebook output for SqlScriptPublishModel. SSMS 18.5 can output a Notebook for Azure Data Studio in Generate Scripts now.
148+
- Fix issue where Table.EnableAllIndexes(Recreate) did nothing
149+
- Fix Database.EnumObjectPermissions usage in NetStandard binaries
150+
151+
- Enabled Security Policy and Security Predicate objects on Azure SQL DataWarehouse
152+
153+
- Enabled Text property for StoredProcedure on Azure SQL Database
154+
- Enabled Database.GetTransactionCount and Database.EnumTransactions on Azure SQL Database
155+
- Added CMK and CEK scripts to "Generating scripts for all database objects" option in SSMS.
156+
- Changed the order of the scripts in SmoUrnFilter.cs to script out the CMK and CEK Scripts before Tables.
157+
- Transferdata unit test cases were failing due to the "USE" statement in the Create Query for CMK and CEK Scripts. Removed "USE" statement
158+
- Updated Transfer/ScriptingBaselines Xml's with the CMK and CEK Scripts for all the versions which supports CMK's and CEK's (2016 and later)
159+
- Updated the ColumnMasterkey.baseline.xml's and ColumnEncryptionKey.baseline.xml's for the versions which supports these keys (Removed USE statement in the create query).
160+
- Enabled support for Column.IsMasked and Column.MaskingFunction for DataWarehouse
161+
- Remove FORCE ORDER hint from table enumeration that was causing major performance issues
162+
- Fix Transfer with PrefetchAllObjects == false for pre-SQL 2014 versions so it doesn't throw an exception
163+
- Added BLOB_STORAGE scripting support for external data sources
164+
- Fixed [error scripting external tables](<https://feedback.azure.com/forums/908035-sql-server/suggestions/38267746-cannot-script-external-table-in-ssms-18-2>) for Azure SQL Database
165+
- Replace Microsoft.SqlServer.Management.SqlParser.dll with a dependency to its Nuget package
166+
- Fixed SMO Column's sensitivity attribute drop failed when attribute is empty
167+
- Remove unneeded "using" TSQL statements from Database.CheckTables method implementations
168+
- Enable ColumnMasterKey properties Signature and AllowEnclaveComputations for Azure SQL DB
169+
- Fix Database.EncryptionEnabled and Database.DatabaseEncryptionKey behavior during Database.Alter(). Now, this code will correctly create a new key using the server certificate named MyCertificate:
170+
171+
```C#
172+
db.EncryptionEnabled = true;
173+
db.DatabaseEncryptionKey.EncryptorName = "MyCertificate";
174+
db.DatabaseEncryptionKey.EncryptionAlgorithm = DatabaseEncryptionAlgorithm.Aes256;
175+
db.DatabaseEncryptionKey.EncryptionType = DatabaseEncryptionType.ServerCertificate;
176+
db.Alter()
177+
```
178+
179+
- Fixed the "like" and "contains" URN filter functions to work with parameters containing single quotes. These operators can be used to optimally initialize collections:
180+
181+
```C#
182+
// populate the collection with databases that have Name starting with "RDA"
183+
var server = Server(new ServerConnection(sqlConnection));
184+
server.Databases.ClearAndInitialize("[like(@Name, 'RDA%')]", new string[] { });
185+
```
186+
187+
- Make Table.Location property optional for creating or scripting external tables.
188+
- Enable scripting of ANSI_PADDING settings for Azure SQL Database tables.
189+
- Remove obsolete types ServerActiveDirectory and DatabaseActiveDirectory

Packages.props

+12-13
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@
88
<DotNetPackagesVersion>4.7.0</DotNetPackagesVersion>
99
</PropertyGroup>
1010
<ItemGroup>
11-
<PackageReference Update="Azure.Core" Version="1.20.0" />
12-
<PackageReference Update="Azure.Identity" Version="1.5.0" />
13-
<PackageReference Update="Azure.Security.KeyVault.Secrets" Version="4.2.0" />
14-
<PackageReference Update="Microsoft.Data.SqlClient" Version="$(SqlClientPackageVersion)" />
11+
<PackageReference Update="Azure.Core" Version="1.24.0" />
12+
<PackageReference Update="Azure.Identity" Version="1.6.0" />
13+
<PackageReference Update="Azure.Security.KeyVault.Secrets" Version="4.4.0" />
14+
<!-- MDS 4+ has breaking changes SMO can't run with -->
15+
<PackageReference Update="Microsoft.Data.SqlClient" Version="[$(SqlClientPackageVersion),4)" />
1516
<PackageReference Update="Microsoft.Data.Tools.StringResourceTool" Version="3.2.0" />
16-
<PackageReference Update="Microsoft.Identity.Client" Version="4.35.0" />
17-
<PackageReference Update="Microsoft.Identity.Client.Desktop" Version="4.35.0" />
18-
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.11.0" />
19-
<PackageReference Update="Microsoft.SqlServer.Assessment" Version="1.0.*" />
17+
<PackageReference Update="Microsoft.Identity.Client" Version="4.39.0" />
18+
<PackageReference Update="Microsoft.Identity.Client.Desktop" Version="4.39.0" />
19+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.4.1" />
20+
<PackageReference Update="Microsoft.SqlServer.Assessment" Version="1.1.9" />
2021
<PackageReference Update="Microsoft.SqlServer.Management.SqlParser" Version="$(SqlParserPackageVersion)" />
2122
<PackageReference Update="Moq" Version="4.16.1" />
22-
<PackageReference Update="MSTest.TestAdapter" Version="2.0.0" />
23-
<PackageReference Update="MSTest.TestFramework" Version="2.0.0" />
24-
<PackageReference Update="NewtonSoft.Json" Version="11.0.1" />
23+
<PackageReference Update="MSTest.TestAdapter" Version="2.2.10" />
24+
<PackageReference Update="MSTest.TestFramework" Version="2.2.10" />
25+
<PackageReference Update="NewtonSoft.Json" Version="13.0.1" />
2526
<PackageReference Update="NUnit" Version="3.11.0" />
2627
<PackageReference Update="System.Buffers" Version="4.5.1" />
2728
<PackageReference Update="System.Data.OleDb" Version="$(DotNetPackagesVersion)" />
@@ -39,7 +40,5 @@
3940
<!-- GlobalPackageReference packages are installed and processed by msbuild but are not referenced by the C# compiler -->
4041
<GlobalPackageReference Include="StrawberryPerl" Version="5.28.0.1" GeneratePathProperty="true" />
4142
</ItemGroup>
42-
<!-- BEGIN NOGITHUB -->
43-
<!-- END NOGITHUB -->
4443

4544
</Project>

0 commit comments

Comments
 (0)