SQL Server 2022: Azure Integration, Query Intelligence, Security, and Data Virtualization
SQL Server 2022 is the most Azure-connected release of SQL Server to date. It introduced bidirectional disaster recovery with Azure SQL Managed Instance, real-time analytics replication via Azure Synapse Link, Microsoft Entra ID authentication for on-premises instances, and a substantially expanded Intelligent Query Processing feature set. This article covers each major pillar: Azure integration, query performance, security, high availability, data virtualization, and T-SQL enhancements, with current status notes where features have evolved since the 2022 release.
Contents
Managed Instance Link: Bidirectional DR
IntermediateThe Managed Instance link connects an on-premises or IaaS SQL Server instance to Azure SQL Managed Instance using Distributed Availability Groups under the hood. SQL Server 2022 introduced a significant capability increase over earlier versions: bidirectional failover with fail back.
| SQL Server Version | Link Capability |
|---|---|
| SQL Server 2016, 2017, 2019 | One-way only: SQL Server is always primary, failover to Managed Instance is one-directional, no fail back |
| SQL Server 2022 | Bidirectional: either SQL Server or Managed Instance can be the initial primary; online and offline fail back both supported |
| SQL Server 2025 | Same bidirectional model, extended with SQL Server 2025 update policy on Managed Instance |
The link operates at the database level, not the instance level. Each database requires its own link. The Managed Instance must be configured with a matching update policy: a SQL Server 2022 instance requires the SQL Server 2022 update policy on the Managed Instance, and a mismatch prevents replication and failover.
Fail back options from Managed Instance to SQL Server 2022 include online fail back using the link directly (with minimal downtime) and offline fail back by taking a backup on Managed Instance and restoring to SQL Server. The online fail back option was in preview as of late 2025; offline fail back is generally available.
Azure Synapse Link for Real-Time Analytics
IntermediateAzure Synapse Link for SQL Server 2022 replicates operational data from SQL Server 2022 to a Synapse Analytics dedicated SQL pool using the change feed mechanism, without requiring a separate ETL pipeline. Changes are replicated in near real time, allowing analytical queries to run against a Synapse pool while OLTP workloads continue uninterrupted on SQL Server.
The change feed works by reading the SQL Server transaction log, similar to CDC. When Synapse Link is enabled on a database, the aggressive log truncation feature of Accelerated Database Recovery (ADR) is automatically disabled for that database, because the change feed needs access to the transaction log. This can cause the transaction log to grow faster than usual under high write volume and must be monitored.
Synapse Link supports two replication modes: continuous (changes replicated with low latency as they occur) and batch (changes accumulated and replicated at a configured interval, lower cost). Synapse Link is not a high availability or disaster recovery feature. It is a data replication path for analytics.
Microsoft Entra ID Authentication
BeginnerSQL Server 2022 introduced support for Microsoft Entra ID authentication for on-premises SQL Server instances on Windows and Linux, and for SQL Server on Azure VMs. This is the first version of SQL Server to support cloud-based identity authentication for instances running outside Azure without additional manual certificate configuration steps (when using Azure Arc registration).
Supported authentication methods include Microsoft Entra Password, Microsoft Entra Integrated (Windows authentication federated through Entra ID), Microsoft Entra Interactive (MFA), Microsoft Entra Managed Identity, and Microsoft Entra Service Principal. The existing SQL authentication and Windows authentication modes remain unchanged and fully supported alongside Entra ID authentication.
| Authentication Method | Use Case |
|---|---|
| Microsoft Entra Integrated | Domain-joined machines with on-premises AD federated to Entra ID; single sign-on without prompts |
| Microsoft Entra Interactive (MFA) | Interactive logins requiring multifactor authentication; recommended for human user access |
| Microsoft Entra Managed Identity | Passwordless authentication for Azure-hosted applications and services |
| Microsoft Entra Service Principal | Application-to-SQL Server authentication using client ID and secret |
| Microsoft Entra Password | Username and password via Entra ID; generally disabled on many tenants for security reasons |
Microsoft Purview Integration
IntermediateSQL Server 2022 integrates with Microsoft Purview for centralized data governance. Purview can discover and catalog on-premises SQL Server data assets, apply sensitivity labels, and manage access policies through the Azure portal. The access policy capability allows granting read or modify access to SQL Server objects directly from Purview without writing T-SQL GRANT statements on each instance.
This integration requires the SQL Server instance to be registered with Azure Arc. Purview integration is primarily relevant for organizations that need centralized governance across a mixed estate of on-premises SQL Server, Azure SQL, and other data sources under a single policy management surface.
Intelligent Query Processing Enhancements
IntermediateSQL Server 2022 expanded the Intelligent Query Processing (IQP) feature set introduced in SQL Server 2019. IQP features adapt query execution based on runtime feedback, stored in Query Store, without requiring code changes to the application or queries. The enhancements in SQL Server 2022 focus on three feedback mechanisms and a new plan optimization feature.
Memory Grant Feedback
Introduced in SQL Server 2019, expanded in 2022. Feedback is now persisted in Query Store, so corrected memory grants survive cache evictions and service restarts. Percentile-based grant sizing reduces over-grant in variable workloads.
Cardinality Estimation Feedback
Detects row count estimate errors and silently adjusts CE hints stored in Query Store. Does not alert users or change the CE model setting. Uses feature_id = 2 in sys.query_store_plan_feedback.
Degree of Parallelism Feedback
Adjusts the effective DOP for individual queries based on observed CPU use and wait time, without changing the instance-level MAXDOP setting. Uses feature_id = 3 in sys.query_store_plan_feedback.
Parameter Sensitive Plan (PSP) Optimization
Allows SQL Server to generate and cache multiple plans for a single parameterized query, one per detected parameter sensitivity bucket. Addresses the parameter sniffing problem for skewed distributions without query hints or plan guides.
The feedback values stored in Query Store can be queried directly to monitor what IQP is adjusting:
-- View active IQP feedback entries in Query Store
SELECT
qsp.query_id,
qspf.feature_id,
CASE qspf.feature_id
WHEN 1 THEN 'Memory Grant Feedback'
WHEN 2 THEN 'CE Feedback'
WHEN 3 THEN 'DOP Feedback'
END AS feature_name,
qspf.feedback_data,
qspf.state_desc,
qspf.create_time,
qspf.last_updated_time
FROM sys.query_store_plan_feedback AS qspf
JOIN sys.query_store_plan AS qsp
ON qspf.plan_id = qsp.plan_id
ORDER BY qspf.last_updated_time DESC;
GO
Query Store Enhancements
BeginnerSQL Server 2022 made two significant changes to Query Store behavior that affect every new database on the instance.
Query Store on by default
For new databases created on SQL Server 2022 instances, Query Store is enabled by default in read-write mode. Databases upgraded from earlier versions or restored from backups are not automatically enabled. This change means baseline query performance data is available from day one on new databases without explicit configuration.
Query Store Hints
Query Store Hints allow applying query hints to specific queries identified by their Query Store query ID, without modifying the application code or the query text. Hints are stored in sys.query_store_query_hints and applied at execution time.
-- Apply a MAXDOP hint to a specific query via Query Store
-- Find the query_id first in sys.query_store_query
EXEC sys.sp_query_store_set_hints
@query_id = 1234,
@query_hints = N'OPTION (MAXDOP 4)';
GO
-- View active Query Store Hints
SELECT
query_hint_id,
query_id,
query_hint_text,
last_query_hint_failure_reason_desc,
is_enabled_by_system
FROM sys.query_store_query_hints;
GO
sp_query_store_set_hints procedure is available on SQL Server 2022 but the hints are only applied when the database is at compatibility level 160.
Ledger for SQL Server
IntermediateLedger for SQL Server provides tamper-evident tables that generate cryptographic proofs of data integrity. Two table types are available: updatable ledger tables, which record a full history of all changes with cryptographic hashes, and append-only ledger tables, which allow only INSERT operations and are suited to audit and event log scenarios.
Each ledger table generates a corresponding history table and a ledger view that exposes the full before-and-after record for every row change. The database ledger stores block digests (SHA-256 hashes of transaction data) that can be stored externally in Azure Confidential Ledger or Azure Blob Storage and used to verify that historical data has not been altered.
-- Create an updatable ledger table
CREATE TABLE dbo.AccountBalances
(
AccountID INT NOT NULL PRIMARY KEY,
AccountName NVARCHAR(50) NOT NULL,
Balance DECIMAL(18,2) NOT NULL
)
WITH (SYSTEM_VERSIONING = ON, LEDGER = ON);
GO
-- Verify database ledger digest
EXEC sys.sp_generate_database_ledger_digest;
GO
Contained Availability Groups
AdvancedContained Availability Groups address a long-standing limitation of standard AGs: only user databases are replicated. Logins, SQL Agent jobs, DB Mail profiles, and linked servers stored in master and msdb do not replicate automatically, requiring manual synchronization between replicas. Contained AGs solve this by maintaining AG-local versions of master and msdb that replicate as part of the AG.
When a contained AG named ProductionAG is created, SQL Server creates two additional databases: ProductionAG_master and ProductionAG_msdb. Logins and Agent jobs created through the AG listener are stored in these AG-local system databases and replicate to all replicas automatically.
| Attribute | Standard AG | Contained AG |
|---|---|---|
| Logins replicated | No; manual sync required | Yes, via AG-local master |
| Agent jobs replicated | No; manual sync required | Yes, via AG-local msdb |
| Jobs run on secondaries | With AG-awareness scripting | No; primary only |
| Distributed AG support | Yes | No in SQL Server 2022; Yes in SQL Server 2025 |
| Replication support | Yes | No |
| Edition | Enterprise and Standard (Basic AG) | Enterprise only |
| Seeding | Manual or automatic | Automatic seeding required at creation in SQL Server 2022 |
Data Virtualization and S3 Object Storage
IntermediateSQL Server 2022 expanded PolyBase data virtualization with REST API-based connectors built directly into the database engine, removing the need for the PolyBase connector services for Azure and S3 targets. The S3-compatible object storage connector is the headline addition: SQL Server 2022 can query CSV, Parquet, and Delta files stored in any S3-compatible storage (AWS S3, MinIO, Dell ObjectScale, NetApp StorageGRID, and others) using standard T-SQL.
Supported external data sources in SQL Server 2022 via REST API connectors:
| Source Type | Connector | Supported File Formats |
|---|---|---|
| Azure Blob Storage (v2) | abs | CSV, Parquet, Delta |
| Azure Data Lake Storage Gen2 | adls | CSV, Parquet, Delta |
| S3-compatible object storage | s3 | CSV, Parquet, Delta |
The PolyBase service installation is still required for ODBC-based connectors (Oracle, Teradata, MongoDB, generic ODBC). For Azure and S3 REST API targets, the capability is in the engine and requires only that the polybase enabled configuration option is set.
-- Enable PolyBase
EXEC sp_configure 'polybase enabled', 1;
RECONFIGURE;
GO
-- Create a database scoped credential for S3
CREATE DATABASE SCOPED CREDENTIAL s3_cred
WITH IDENTITY = 'S3 Access Key',
SECRET = 'AccessKeyID:SecretKeyID';
GO
-- Create an external data source pointing to an S3 bucket
CREATE EXTERNAL DATA SOURCE S3_DataLake
WITH (
LOCATION = 's3://s3.us-east-1.amazonaws.com/your-bucket',
CREDENTIAL = s3_cred
);
GO
-- Query a Parquet file in S3 with T-SQL
SELECT *
FROM OPENROWSET(
BULK 'sales/2024/transactions.parquet',
DATA_SOURCE = 'S3_DataLake',
FORMAT = 'PARQUET'
) AS parquet_data;
GO
s3://hostname/bucket-name). Virtual-hosted style URLs do not work. The total URL length including the s3:// prefix cannot exceed 259 characters.
SQL Server 2022 also added BACKUP TO URL and RESTORE FROM URL support for S3-compatible storage, allowing backups to be written directly to on-premises or cloud S3 endpoints without Azure Blob Storage as an intermediary.
-- Backup to S3-compatible storage
BACKUP DATABASE AdventureWorks2022
TO URL = 's3://s3.us-east-1.amazonaws.com/sql-backups/AdventureWorks2022_full.bak'
WITH CREDENTIAL = 's3_cred', COMPRESSION, STATS = 10;
GO
T-SQL Enhancements
BeginnerSQL Server 2022 introduced a set of T-SQL functions and syntax improvements across JSON handling, date and time, string processing, and bit manipulation.
| Category | New Functions / Features |
|---|---|
| JSON | IS_JSON enhancement, JSON_PATH_EXISTS, JSON_OBJECT, JSON_ARRAY — constructors for building JSON inline in T-SQL without string concatenation |
| Date and time | DATETRUNC for truncating a date to a specified granularity (year, month, day, hour, and so on); GENERATE_SERIES for producing a sequence of values including dates |
| String | TRIM enhancements (trim specific characters); LTRIM and RTRIM character argument; STRING_SPLIT with ordinal column to preserve split order |
| Bit manipulation | GET_BIT, SET_BIT, BIT_COUNT, LEFT_SHIFT, RIGHT_SHIFT for bitwise operations without casting |
| Window functions | FIRST_VALUE and LAST_VALUE with the IGNORE NULLS option |
| Approximate aggregates | APPROX_PERCENTILE_CONT and APPROX_PERCENTILE_DISC for fast approximate percentile calculation on large datasets |
-- DATETRUNC example: truncate to start of month
SELECT DATETRUNC(MONTH, GETDATE()) AS start_of_month;
-- GENERATE_SERIES: produce a date series
SELECT CAST(DATEADD(DAY, value - 1, '2024-01-01') AS DATE) AS series_date
FROM GENERATE_SERIES(1, 365);
-- JSON_OBJECT: build JSON without string concatenation
SELECT JSON_OBJECT(
'name' : FirstName,
'dept' : Department,
'salary' : Salary
)
FROM dbo.Employees;
-- STRING_SPLIT with ordinal (preserves token order)
SELECT value, ordinal
FROM STRING_SPLIT('alpha,beta,gamma', ',', 1)
ORDER BY ordinal;
GO
References
- Microsoft Docs: What’s New in SQL Server 2022
- Microsoft Docs: Managed Instance Link Feature Overview
- Microsoft Docs: Disaster Recovery with Managed Instance Link
- Microsoft Docs: Azure Synapse Link for SQL Server 2022
- Microsoft Docs: Azure Synapse Link for SQL Known Issues and Limitations
- Microsoft Docs: Microsoft Entra Authentication for SQL Server Overview
- Microsoft Docs: New Name for Azure Active Directory (Microsoft Entra ID)
- Microsoft Docs: Ledger Overview
- Microsoft Docs: Contained Availability Groups Overview
- Microsoft Docs: PolyBase Overview and Data Virtualization
- Microsoft Docs: Query Store Hints
- Microsoft Docs: Intelligent Query Processing
- SQLYARD: SQL Server Performance Tuning Complete Guide
- SQLYARD: SQL Server Query Store Complete Guide
- SQLYARD: Always On Availability Groups Guide
- SQLYARD: HA and DR Options for SQL Server 2025
- SQLYARD: Cardinality Estimation Feedback in SQL Server 2022 and 2025
- SQLYARD: DOP Feedback in SQL Server 2025
Discover more from SQLYARD
Subscribe to get the latest posts sent to your email.


