Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit b52e896

Browse files
committed
Clarify support for sp_addmessage on Azure SQL
1 parent d17af15 commit b52e896

3 files changed

Lines changed: 74 additions & 69 deletions

File tree

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: Resolving T-SQL differences-migration
3-
description: T-SQL statements that are less than fully supported in Azure SQL Database.
2+
title: T-SQL Differences Between SQL Server and Azure SQL Database
3+
description: This article discusses the Transact-SQL (T-SQL) differences between an Azure SQL Database and SQL Server.
44
author: croblesm
55
ms.author: roblescarlos
6-
ms.reviewer: wiassaf, mathoma
7-
ms.date: 06/17/2021
6+
ms.reviewer: wiassaf, mathoma, randolphwest
7+
ms.date: 11/22/2024
88
ms.service: azure-sql-database
99
ms.subservice: migration
1010
ms.topic: reference
@@ -15,50 +15,50 @@ ms.custom:
1515
---
1616
# T-SQL differences between SQL Server and Azure SQL Database
1717

18-
When [migrating your database](migrate-to-database-from-sql-server.md) from SQL Server to Azure SQL Database, you may discover that your SQL Server databases require some re-engineering before they can be migrated. This article provides guidance to assist you in both performing this re-engineering and understanding the underlying reasons why the re-engineering is necessary. To detect incompatibilities and migrate databases to Azure SQL Database, use [Data Migration Assistant (DMA)](/sql/dma/dma-overview).
18+
When [migrating your database](migrate-to-database-from-sql-server.md) from SQL Server to Azure SQL Database, you might discover that your SQL Server databases require some re-engineering before they can be migrated. This article provides guidance to assist you in both performing this re-engineering and understanding the underlying reasons why the re-engineering is necessary. To detect incompatibilities and migrate databases to Azure SQL Database, use [Azure Data Migration Service](/azure/dms).
1919

2020
[!INCLUDE [entra-id](../includes/entra-id.md)]
2121

2222
## Overview
2323

24-
Most T-SQL features that applications use are fully supported in both Microsoft SQL Server and Azure SQL Database. For example, the core SQL components such as data types, operators, string, arithmetic, logical, and cursor functions work identically in SQL Server and SQL Database. There are, however, a few T-SQL differences in DDL (data definition language) and DML (data manipulation language) elements resulting in T-SQL statements and queries that are only partially supported (which we discuss later in this article).
24+
Most Transact-SQL (T-SQL) features that applications use are fully supported in both Microsoft SQL Server and Azure SQL Database. For example, the core SQL components such as data types, operators, string, arithmetic, logical, and cursor functions work identically in SQL Server and SQL Database. There are, however, a few T-SQL differences in DDL (data definition language) and DML (data manipulation language) elements resulting in T-SQL statements and queries that are only partially supported (which we discuss later in this article).
2525

26-
In addition, there are some features and syntax that isn't supported at all because Azure SQL Database is designed to isolate features from dependencies on the system databases and the operating system. As such, most instance-level features are not supported in SQL Database. T-SQL statements and options aren't available if they configure instance-level options, operating system components, or specify file system configuration. When such capabilities are required, an appropriate alternative is often available in some other way from SQL Database or from another Azure feature or service.
26+
In addition, there are some features and syntax that isn't supported at all because Azure SQL Database is designed to isolate features from dependencies on the system databases and the operating system. As such, most instance-level features aren't supported in SQL Database. T-SQL statements and options aren't available if they configure instance-level options, operating system components, or specify file system configuration. When such capabilities are required, an appropriate alternative is often available in some other way from SQL Database or from another Azure feature or service.
2727

28-
For example, high availability is built into Azure SQL Database. T-SQL statements related to availability groups are not supported by SQL Database, and the dynamic management views related to Always On Availability Groups are also not supported.
28+
For example, high availability is built into Azure SQL Database. T-SQL statements related to availability groups aren't supported by SQL Database, and the dynamic management views related to Always On Availability Groups are also not supported.
2929

30-
For a list of the features that are supported and unsupported by SQL Database, see [Azure SQL Database feature comparison](features-comparison.md). This page supplements that article, and focuses on T-SQL statements.
30+
For a list of the features that are supported and unsupported by SQL Database, see [Features comparison: Azure SQL Database and Azure SQL Managed Instance](features-comparison.md). This page supplements that article, and focuses on T-SQL statements.
3131

3232
## T-SQL syntax statements with partial differences
3333

34-
The core DDL statements are available, but DDL statement extensions related to unsupported features, such as file placement on disk, are not supported.
34+
The core DDL statements are available, but DDL statement extensions related to unsupported features, such as file placement on disk, aren't supported.
3535

36-
- In SQL Server, `CREATE DATABASE` and `ALTER DATABASE` statements have over three dozen options. The statements include file placement, FILESTREAM, and service broker options that only apply to SQL Server. This may not matter if you create databases in SQL Database before you migrate, but if you're migrating T-SQL code that creates databases you should compare [CREATE DATABASE (Azure SQL Database)](/sql/t-sql/statements/create-database-transact-sql?view=azuresqldb-current&preserve-view=true) with the SQL Server syntax at [CREATE DATABASE (SQL Server T-SQL)](/sql/t-sql/statements/create-database-transact-sql?view=sql-server-ver15&preserve-view=true) to make sure all the options you use are supported. `CREATE DATABASE` for Azure SQL Database also has service objective and elastic pool options that apply only to SQL Database.
36+
- In SQL Server, `CREATE DATABASE` and `ALTER DATABASE` statements have over three dozen options. The statements include file placement, FILESTREAM, and service broker options that only apply to SQL Server. This might not matter if you create databases in SQL Database before you migrate, but if you're migrating T-SQL code that creates databases you should compare [CREATE DATABASE (Azure SQL Database)](/sql/t-sql/statements/create-database-transact-sql?view=azuresqldb-current&preserve-view=true) with the SQL Server syntax at [CREATE DATABASE (SQL Server T-SQL)](/sql/t-sql/statements/create-database-transact-sql?view=sql-server-ver15&preserve-view=true) to make sure all the options you use are supported. `CREATE DATABASE` for Azure SQL Database also has service objective and elastic pool options that apply only to SQL Database.
3737
- The `CREATE TABLE` and `ALTER TABLE` statements have `FILETABLE` and `FILESTREAM` options that can't be used on SQL Database because these features aren't supported.
38-
- `CREATE LOGIN` and `ALTER LOGIN` statements are supported, but do not offer all options available in SQL Server. To make your database more portable, SQL Database encourages using contained database users instead of logins whenever possible. For more information, see [CREATE LOGIN](/sql/t-sql/statements/create-login-transact-sql?view=azuresqldb-current&preserve-view=true) and [ALTER LOGIN](/sql/t-sql/statements/alter-login-transact-sql?view=azuresqldb-current&preserve-view=true) and [Manage logins and users](logins-create-manage.md).
38+
- `CREATE LOGIN` and `ALTER LOGIN` statements are supported, but don't offer all options available in SQL Server. To make your database more portable, SQL Database encourages using contained database users instead of logins whenever possible. For more information, see [CREATE LOGIN](/sql/t-sql/statements/create-login-transact-sql?view=azuresqldb-current&preserve-view=true), [ALTER LOGIN](/sql/t-sql/statements/alter-login-transact-sql?view=azuresqldb-current&preserve-view=true), and [Authorize database access to SQL Database, SQL Managed Instance, and Azure Synapse Analytics](logins-create-manage.md).
3939

4040
## T-SQL syntax not supported in Azure SQL Database
4141

42-
In addition to T-SQL statements related to the unsupported features described in [Azure SQL Database feature comparison](features-comparison.md), the following statements and groups of statements aren't supported. As such, if your database to be migrated is using any of the following features, re-engineer your application to eliminate these T-SQL features and statements.
42+
In addition to T-SQL statements related to the unsupported features described in [Features comparison: Azure SQL Database and Azure SQL Managed Instance](features-comparison.md), the following statements and groups of statements aren't supported. As such, if your database to be migrated is using any of the following features, re-engineer your application to eliminate these T-SQL features and statements.
4343

4444
- Collation of system objects.
45-
- Connection related: Endpoint statements. SQL Database doesn't support Windows authentication, but does support Microsoft Entra authentication. This includes authentication of Active Directory principals federated with Microsoft Entra ID ([formerly Azure Active Directory](/entra/fundamentals/new-name)). For more information, see [Connecting to SQL Database or Azure Azure Synapse Analytics By Using Microsoft Entra authentication](authentication-aad-overview.md).
45+
- Connection related: Endpoint statements. SQL Database doesn't support Windows authentication, but does support Microsoft Entra authentication. This includes authentication of Active Directory principals federated with [Microsoft Entra ID](/entra/fundamentals/new-name). For more information, see [Microsoft Entra authentication for Azure SQL](authentication-aad-overview.md).
4646
- Cross-database and cross-instance queries using three or four part names. Three part names referencing the `tempdb` database and the current database are supported. [Elastic query](elastic-query-overview.md) supports read-only references to tables in other MSSQL databases.
4747
- Cross database ownership chaining and the `TRUSTWORTHY` database property.
4848
- `EXECUTE AS LOGIN`. Use `EXECUTE AS USER` instead.
49-
- Extensible key management (EKM) for encryption keys. Transparent Data Encryption (TDE) [customer-managed keys](transparent-data-encryption-byok-overview.md) and Always Encrypted [column master keys](always-encrypted-azure-key-vault-configure.md) may be stored in Azure Key Vault.
49+
- Extensible key management (EKM) for encryption keys. Transparent data encryption (TDE) [customer-managed keys](transparent-data-encryption-byok-overview.md) and Always Encrypted [column master keys](always-encrypted-azure-key-vault-configure.md) can be stored in Azure Key Vault.
5050
- Eventing: event notifications, query notifications.
5151
- File properties: Syntax related to database file name, placement, size, and other file properties automatically managed by SQL Database.
5252
- High availability: Syntax related to high availability and database recovery, which are managed by SQL Database. This includes syntax for backup, restore, Always On, database mirroring, log shipping, recovery models.
53-
- Syntax related to snapshot, transactional, and merge replication, which is not available in SQL Database. [Replication subscriptions](replication-to-sql-database.md) are supported.
53+
- Syntax related to snapshot, transactional, and merge replication, which isn't available in SQL Database. [Replication subscriptions](replication-to-sql-database.md) are supported.
5454
- Functions: `fn_get_sql`, `fn_virtualfilestats`, `fn_virtualservernodes`.
5555
- Instance configuration: Syntax related to server memory, worker threads, CPU affinity, trace flags. Use service tiers and compute sizes instead.
5656
- `KILL STATS JOB`.
5757
- `OPENQUERY`, `OPENDATASOURCE`, and four-part names.
58-
- .NET Framework: CLR integration
58+
- .NET Framework: common language runtime (CLR) integration
5959
- Semantic search
6060
- Server credentials: Use [database scoped credentials](/sql/t-sql/statements/create-database-scoped-credential-transact-sql) instead.
61-
- Server-level permissions: `GRANT`, `REVOKE`, and `DENY` of server level permissions are not supported. Some server-level permissions are replaced by database-level permissions, or granted implicitly by built-in server roles. Some server-level DMVs and catalog views have similar database-level views.
61+
- Server-level permissions: `GRANT`, `REVOKE`, and `DENY` of server level permissions aren't supported. Some server-level permissions are replaced by database-level permissions, or granted implicitly by built-in server roles. Some server-level DMVs and catalog views have similar database-level views.
6262
- `SET REMOTE_PROC_TRANSACTIONS`
6363
- `SHUTDOWN`
6464
- `sp_addmessage`
@@ -75,16 +75,15 @@ In addition to T-SQL statements related to the unsupported features described in
7575

7676
## Full T-SQL reference
7777

78-
For more information about T-SQL grammar, usage, and examples, see [T-SQL Reference (Database Engine)](/sql/t-sql/language-reference).
78+
For more information about T-SQL grammar, usage, and examples, see [Transact-SQL reference (Database Engine)](/sql/t-sql/language-reference).
7979

8080
### About the "Applies to" tags
8181

82-
The T-SQL reference includes articles related to all recent SQL Server versions. Below the article title there's an icon bar, listing MSSQL platforms, and indicating applicability. For example, availability groups were introduced in SQL Server 2012. The [CREATE AVAILABILITY GROUP](/sql/t-sql/statements/create-availability-group-transact-sql) article indicates that the statement applies to **SQL Server (starting with 2012)**. The statement doesn't apply to SQL Server 2008, SQL Server 2008 R2, Azure SQL Database, Azure Azure Synapse Analytics, or Parallel Data Warehouse.
82+
The T-SQL reference includes articles related to all recent SQL Server versions. Below the article title there's an icon bar, listing MSSQL platforms, and indicating applicability. For example, availability groups were introduced in SQL Server 2012. The [CREATE AVAILABILITY GROUP](/sql/t-sql/statements/create-availability-group-transact-sql) article indicates that the statement applies to **SQL Server (starting with 2012)**. The statement doesn't apply to SQL Server 2008, SQL Server 2008 R2, Azure SQL Database, Azure Synapse Analytics, or Parallel Data Warehouse.
8383

8484
In some cases, the general subject of an article can be used in a product, but there are minor differences between products. The differences are indicated at midpoints in the article as appropriate. For example, the `CREATE TRIGGER` article is available in SQL Database. But the `ALL SERVER` option for server-level triggers, indicates that server-level triggers can't be used in SQL Database. Use database-level triggers instead.
8585

86-
## Next steps
86+
## Related content
8787

88-
For a list of the features that are supported and unsupported by SQL Database, see [Azure SQL Database feature comparison](features-comparison.md).
89-
90-
To detect compatibility issues in your SQL Server databases before migrating to Azure SQL Database, and to migrate your databases, use [Data Migration Assistant (DMA)](/sql/dma/dma-overview).
88+
- [Features comparison: Azure SQL Database and Azure SQL Managed Instance](features-comparison.md)
89+
- [Overview of Data Migration Assistant](/sql/dma/dma-overview)

0 commit comments

Comments
 (0)