SQL Server 到 Azure SQL 数据库迁移的评估规则Assessment rules for SQL Server to Azure SQL Database migration

适用于: Azure SQL 数据库

迁移工具通过运行大量评估规则来验证源 SQL Server 实例,以确定在将 SQL Server 数据库迁移到 Azure SQL 数据库之前必须解决的问题。Migration tools validate your source SQL Server instance by running a number of assessment rules to identify issues that must be addressed before migrating your SQL Server database to Azure SQL Database.

本文列举了用于评估将 SQL Server 数据库迁移到 Azure SQL 数据库的可行性的规则。This article provides a list of the rules used to assess the feasibility of migrating your SQL Server database to Azure SQL Database.

大容量插入Bulk insert

标题:使用非 Azure Blob 数据源的 BULK INSERT 在 Azure SQL 数据库中不受支持。 Title: BULK INSERT with non-Azure blob data source is not supported in Azure SQL Database.
类别:问题Category: Issue

描述 Description
Azure SQL 数据库无法访问文件共享或 Windows 文件夹。Azure SQL Database cannot access file shares or Windows folders. 请查看“受影响的对象”部分,了解 BULK INSERT 语句的特定用法,这些语句不引用 Azure Blob。See the "Impacted Objects" section for the specific uses of BULK INSERT statements that do not reference an Azure blob. 如果源不是 Azure Blob 存储,则在迁移到 Azure SQL 数据库后,使用“BULK INSERT”的对象将无法正常运行。Objects with 'BULK INSERT' where the source is not Azure blob storage will not work after migrating to Azure SQL Database.

建议 Recommendation
迁移到 Azure SQL 数据库时,需要将 BULK INSERT 语句从使用本地文件或文件共享转换为使用 Azure Blob 存储中的文件。You will need to convert BULK INSERT statements that use local files or file shares to use files from Azure blob storage instead, when migrating to Azure SQL Database. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

COMPUTE 子句Compute clause

标题:COMPUTE 子句已弃用,并且已被删除。 Title: COMPUTE clause is discontinued and has been removed.
类别:警告Category: Warning

描述 Description
COMPUTE 子句生成的总计在结果集的末尾显示为附加的汇总列。The COMPUTE clause generates totals that appear as additional summary columns at the end of the result set. 但是,此子句在 Azure SQL 数据库中不再受支持。However, this clause is no longer supported in Azure SQL Database.

建议 Recommendation
需要改用 ROLLUP 运算符来重新编写 T-SQL 模块。The T-SQL module needs to be rewritten using the ROLLUP operator instead. 下面的代码演示如何将 COMPUTE 替换为 ROLLUP:The code below demonstrates how COMPUTE can be replaced with ROLLUP:

USE AdventureWorks 
GO;  

SELECT SalesOrderID, UnitPrice, UnitPriceDiscount 
FROM Sales.SalesOrderDetail 
ORDER BY SalesOrderID COMPUTE SUM(UnitPrice), SUM(UnitPriceDiscount) BY SalesOrderID GO; 

SELECT SalesOrderID, UnitPrice, UnitPriceDiscount,SUM(UnitPrice) as UnitPrice , 
SUM(UnitPriceDiscount) as UnitPriceDiscount 
FROM Sales.SalesOrderDetail 
GROUP BY SalesOrderID, UnitPrice, UnitPriceDiscount WITH ROLLUP; 

有关详细信息,请参阅 SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine functionality in SQL Server

变更数据捕获 (CDC)Change data capture (CDC)

标题:Azure SQL 数据库中不支持 (CDC) 变更数据捕获 Title: Change Data Capture (CDC) is not supported in Azure SQL Database
类别:问题Category: Issue

描述 Description
Azure SQL 数据库中不支持 (CDC) 变更数据捕获。Change Data Capture (CDC) is not supported in Azure SQL Database. 评估是否可改用更改跟踪。Evaluate if Change Tracking can be used instead. 或者,迁移到 Azure SQL 托管实例或 Azure 虚拟机上的 SQL Server。Alternatively, migrate to Azure SQL Managed Instance or SQL Server on Azure Virtual Machines.

建议 Recommendation
Azure SQL 数据库中不支持 (CDC) 变更数据捕获。Change Data Capture (CDC) is not supported in Azure SQL Database. 评估是否可改为使用更改跟踪或考虑迁移到 Azure SQL 托管实例。Evaluate if Change Tracking can be used instead or consider migrating to Azure SQL Managed Instance.

有关详细信息,请参阅启用 Azure SQL 更改跟踪More information: Enable Azure SQL change tracking

CLR 程序集CLR assemblies

标题:Azure SQL 数据库中不支持 SQL CLR 程序集 Title: SQL CLR assemblies are not supported in Azure SQL Database
类别:问题Category: Issue

描述 Description
Azure SQL 数据库不支持 SQL CLR 程序集。Azure SQL Database does not support SQL CLR assemblies.

建议 Recommendation
目前无法在 Azure SQL 数据库中实现此目的。Currently, there is no way to achieve this in Azure SQL Database. 建议的替代解决方案将要求应用程序代码和数据库更改仅使用 Azure SQL 数据库支持的程序集。The recommended alternative solutions will require application code and database changes to use only assemblies supported by Azure SQL Database. 或者,迁移到 Azure SQL 托管实例或 Azure 虚拟机上的 SQL ServerAlternatively migrate to Azure SQL Managed Instance or SQL Server on Azure Virtual Machine

有关详细信息,请参阅 SQL 数据库中不支持的 Transact-SQL 差异More information: Unsupported Transact-SQL differences in SQL Database

Cryptographic providerCryptographic provider

标题:已发现使用了 CREATE CRYPTOGRAPHIC PROVIDER 或 ALTER CRYPTOGRAPHIC PROVIDER,但这两个语句在 Azure SQL 数据库中不受支持 Title: A use of CREATE CRYPTOGRAPHIC PROVIDER or ALTER CRYPTOGRAPHIC PROVIDER was found, which is not supported in Azure SQL Database
类别:问题Category: Issue

描述 Description
Azure SQL 数据库不支持 CRYPTOGRAPHIC PROVIDER 语句,因为它无法访问文件。Azure SQL Database does not support CRYPTOGRAPHIC PROVIDER statements because it cannot access files. 请查看“受影响的对象”部分,了解 CRYPTOGRAPHIC PROVIDER 语句的特定用法。See the Impacted Objects section for the specific uses of CRYPTOGRAPHIC PROVIDER statements. 使用 CREATE CRYPTOGRAPHIC PROVIDERALTER CRYPTOGRAPHIC PROVIDER 的对象在迁移到 Azure SQL 数据库后将无法正常运行。Objects with CREATE CRYPTOGRAPHIC PROVIDER or ALTER CRYPTOGRAPHIC PROVIDER will not work correctly after migrating to Azure SQL Database.

建议 Recommendation
查看使用了 CREATE CRYPTOGRAPHIC PROVIDERALTER CRYPTOGRAPHIC PROVIDER 的对象。Review objects with CREATE CRYPTOGRAPHIC PROVIDER or ALTER CRYPTOGRAPHIC PROVIDER. 在必须使用的任何此类对象中,删除所使用的这些功能。In any such objects that are required, remove the uses of these features. 或者,迁移到 Azure 虚拟机上的 SQL ServerAlternatively, migrate to SQL Server on Azure Virtual Machine

跨数据库引用Cross database references

标题:Azure SQL 数据库不支持跨数据库查询 Title: Cross-database queries are not supported in Azure SQL Database
类别:问题Category: Issue

描述 Description
此服务器上的数据库使用了 Azure SQL 数据库中不支持的跨数据库查询。Databases on this server use cross-database queries, which are not supported in Azure SQL Database.

建议 Recommendation
Azure SQL 数据库不支持跨数据库查询。Azure SQL Database does not support cross-database queries. 建议执行以下操作:The following actions are recommended:

  • 将从属数据库迁移到 Azure SQL 数据库,并使用弹性数据库查询(目前为预览版)功能跨 Azure SQL 数据库进行查询。Migrate the dependent database(s) to Azure SQL Database and use Elastic Database Query (Currently in preview) functionality to query across Azure SQL databases.
  • 将从属数据集从其他数据库移入要迁移的数据库。Move the dependent datasets from other databases into the database that is being migrated.
  • 迁移到 Azure SQL 托管实例。Migrate to Azure SQL Managed Instance.
  • 迁移到 Azure 虚拟机上的 SQL Server。Migrate to SQL Server on Azure Virtual Machine.

有关详细信息,请参阅 Azure SQL 数据库弹性数据库查询(预览版)More information: Check Azure SQL Database elastic database query (Preview)

数据库兼容性Database compatibility

标题:Azure SQL 数据库不支持低于 100 的兼容性级别。 Title: Azure SQL Database doesn't support compatibility levels below 100.
类别:警告Category: Warning

描述 Description
数据库兼容性级别是一个非常有用的工具,借助该工具,可以在升级 SQL Server 数据库引擎的同时,通过保持与升级前相同的数据库兼容性级别来使连接应用程序保持正常运行状态,从而帮助实现数据库现代化。Database compatibility level is a valuable tool to assist in database modernization, by allowing the SQL Server Database Engine to be upgraded, while keeping connecting applications functional status by maintaining the same pre-upgrade database compatibility level. Azure SQL 数据库不支持低于 100 的兼容性级别。Azure SQL Database doesn't support compatibility levels below 100.

建议 Recommendation
在 Azure SQL 托管实例上将数据库兼容性级别升级到 100 后,评估应用程序功能是否完好无损。Evaluate if the application functionality is intact when the database compatibility level is upgraded to 100 on Azure SQL Managed Instance. 或者,迁移到 Azure 虚拟机上的 SQL ServerAlternatively, migrate to SQL Server on Azure Virtual Machine

数据库邮件Database mail

标题:Azure SQL 数据库中不支持数据库邮件。 Title: Database Mail is not supported in Azure SQL Database.
类别:警告Category: Warning

描述 Description
此服务器使用 Azure SQL 数据库中不支持的数据库邮件功能。This server uses the Database Mail feature, which is not supported in Azure SQL Database.

建议 Recommendation
请考虑迁移到支持数据库邮件的 Azure SQL 托管实例。Consider migrating to Azure SQL Managed Instance that supports Database Mail. 另外,请考虑使用 Azure Functions 和 Sendgrid 在 Azure SQL 数据库上完成邮件功能。Alternatively, consider using Azure functions and Sendgrid to accomplish mail functionality on Azure SQL Database.

有关详细信息,请参阅使用 Azure Functions 脚本从 Azure SQL 数据库发送电子邮件More information: Send email from Azure SQL Database using Azure Functions script

DATABASE_PRINCIPAL_ALIASESDatabase principal alias

标题:SYS.DATABASE_PRINCIPAL_ALIASES 已弃用,并且已被删除。 Title: SYS.DATABASE_PRINCIPAL_ALIASES is discontinued and has been removed.
类别:问题Category: Issue

描述 Description
Azure SQL 数据库已弃用SYS.DATABASE_PRINCIPAL_ALIASES 并已将其删除。SYS.DATABASE_PRINCIPAL_ALIASES is discontinued and has been removed in Azure SQL Database.

建议 Recommendation
请使用角色而不是别名。Use roles instead of aliases.

有关详细信息,请参阅 SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine functionality in SQL Server

DISABLE_DEF_CNST_CHK 选项DISABLE_DEF_CNST_CHK option

标题:SET 选项 DISABLE_DEF_CNST_CHK 已弃用,并且已被删除。 Title: SET option DISABLE_DEF_CNST_CHK is discontinued and has been removed.
类别:问题Category: Issue

描述 Description
Azure SQL 数据库已弃用 SET option DISABLE_DEF_CNST_CHK 并已将其删除。SET option DISABLE_DEF_CNST_CHK is discontinued and has been removed in Azure SQL Database.

有关详细信息,请参阅 SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine functionality in SQL Server

FASTFIRSTROW 提示FASTFIRSTROW hint

标题:FASTFIRSTROW 查询提示已弃用,并且已被删除。 Title: FASTFIRSTROW query hint is discontinued and has been removed.
类别:警告Category: Warning

描述 Description
Azure SQL 数据库已弃用 FASTFIRSTROW 查询提示并已将其删除。FASTFIRSTROW query hint is discontinued and has been removed in Azure SQL Database.

建议 Recommendation
FASTFIRSTROW 查询提示改用 OPTION (FAST n)。Instead of FASTFIRSTROW query hint use OPTION (FAST n).

有关详细信息,请参阅 SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine functionality in SQL Server

文件流FileStream

标题:Azure SQL 数据库不支持文件流 Title: Filestream is not supported in Azure SQL Database
类别:问题Category: Issue

描述 Description
文件流功能使用户可以在 NTFS 文件系统中存储文本文档、图像和视频等非结构化数据,但此功能在 Azure SQL 数据库中不受支持。The Filestream feature, which allows you to store unstructured data such as text documents, images, and videos in NTFS file system, is not supported in Azure SQL Database.

建议 Recommendation
将非结构化文件上传到 Azure Blob 存储,并在 Azure SQL 数据库中存储与这些文件相关的元数据(名称、类型、URL 位置、存储密钥等)。Upload the unstructured files to Azure Blob storage and store metadata related to these files (name, type, URL location, storage key etc.) in Azure SQL Database. 可能需要对应用程序进行重新设计,以实现与 Azure SQL 数据库的 Blob 流式传输。You may have to re-engineer your application to enable streaming blobs to and from Azure SQL Database. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

有关详细信息,请参阅 与 SQL Azure 的 Blob 流式传输博客More information: Streaming blobs to and from Azure SQL blog

链接服务器Linked server

标题:Azure SQL 数据库不支持链接服务器功能 Title: Linked server functionality is not supported in Azure SQL Database
类别:问题Category: Issue

描述 Description
链接服务器使 SQL Server 数据库引擎可以对 SQL Server 实例外部的 OLE DB 数据源执行命令。Linked servers enable the SQL Server Database Engine to execute commands against OLE DB data sources outside of the instance of SQL Server.

建议 Recommendation
Azure SQL 数据库不支持链接服务器功能。Azure SQL Database does not support linked server functionality. 建议执行以下操作以避免需要使用链接服务器:The following actions are recommended to eliminate the need for linked servers:

  • 确定哪些从属数据集属于 SQL 远程服务器,并考虑将它们移到要迁移的数据库中。Identify the dependent datasets from remote SQL servers and consider moving these into the database being migrated.
  • 将从属数据库迁移到 Azure,并使用弹性数据库查询(目前为预览版)功能跨 Azure SQL 数据库进行查询。Migrate the dependent database(s) to Azure and use Elastic Database Query (preview) functionality to query across databases in Azure SQL Database.

有关详细信息,请参阅 Azure SQL 数据库弹性查询(预览版)More information: Check Azure SQL Database elastic query (Preview)

MS DTCMS DTC

标题:Azure SQL 数据库不支持 BEGIN DISTRIBUTED TRANSACTION。 Title: BEGIN DISTRIBUTED TRANSACTION is not supported in Azure SQL Database.
类别:问题Category: Issue

描述 Description
由 Transact SQL BEGIN DISTRIBUTED TRANSACTION 启动并由 Microsoft 分布式事务处理协调器 (MS DTC) 管理的分布式事务在 Azure SQL 数据库中不受支持。Distributed transaction started by Transact SQL BEGIN DISTRIBUTED TRANSACTION and managed by Microsoft Distributed Transaction Coordinator (MS DTC) is not supported in Azure SQL Database.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看使用 BEGIN DISTRUBUTED TRANSACTION 的所有对象。Review impacted objects section in Azure Migrate to see all objects using BEGIN DISTRUBUTED TRANSACTION. 考虑将参与者数据库迁移到 Azure SQL 托管实例,其中支持跨多个实例的分布式事务(目前处于预览阶段)。Consider migrating the participant databases to Azure SQL Managed Instance where distributed transactions across multiple instances are supported (Currently in preview). 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

详细信息:Azure SQL 托管实例的跨多个服务器的事务More information: Transactions across multiple servers for Azure SQL Managed Instance

OPENROWSET(批量)OPENROWSET (bulk)

标题:Azure SQL 数据库不支持将批量操作中使用的 OpenRowSet 用于非 Azure Blob 存储数据源。 Title: OpenRowSet used in bulk operation with non-Azure blob storage data source is not supported in Azure SQL Database.
类别:问题Category: Issue

说明 OPENROWSET 通过内置的 BULK 提供程序支持批量操作,该提供程序使文件中的数据可被读取并作为行集返回。Description OPENROWSET supports bulk operations through a built-in BULK provider that enables data from a file to be read and returned as a rowset. Azure SQL 数据库不支持将 OPENROWSET 用于非 Azure Blob 存储数据源。OPENROWSET with non-Azure blob storage data source is not supported in Azure SQL Database.

建议 Recommendation
Azure SQL 数据库无法访问文件共享和 Windows 文件夹,因此必须从 Azure Blob 存储导入文件。Azure SQL Database cannot access file shares and Windows folders, so the files must be imported from Azure blob storage. 因此,OPENROWSET 函数中仅支持 DATASOURCE Blob 类型。Therefore, only blob type DATASOURCE is supported in OPENROWSET function. 或者,迁移到 Azure 虚拟机上的 SQL ServerAlternatively, migrate to SQL Server on Azure Virtual Machine

有关详细信息,请参阅解析迁移到 SQL 数据库的过程中的 Transact-SQL 差异More information: Resolving Transact-SQL differences during migration to SQL Database

OPENROWSET(提供程序)OPENROWSET (provider)

标题:Azure SQL 数据库不支持将 OpenRowSet 用于 SQL 或非 SQL 提供程序。 Title: OpenRowSet with SQL or non-SQL provider is not supported in Azure SQL Database.
类别:问题Category: Issue

描述 Description
将 OpenRowSet 用于 SQL 或非 SQL 提供程序是一种替代方法,并且是一种使用 OLE DB 连接并访问远程数据的一次性的临时方法。OpenRowSet with SQL or non-SQL provider is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data by using OLE DB. Azure SQL 数据库不支持将 OpenRowSet 用于 SQL 或非 SQL 提供程序。OpenRowSet with SQL or non-SQL provider is not supported in Azure SQL Database.

建议 Recommendation
Azure SQL 数据库仅支持从 Azure blob 存储进行导入。Azure SQL Database supports OPENROWSET only to import from Azure blob storage. 或者,迁移到 Azure 虚拟机上的 SQL ServerAlternatively, migrate to SQL Server on Azure Virtual Machine

有关详细信息,请参阅解析迁移到 SQL 数据库的过程中的 Transact-SQL 差异More information: Resolving Transact-SQL differences during migration to SQL Database

非 ANSI 左外部联接Non-ANSI left outer join

标题:非 ANSI 样式左外部联接已弃用,并且已被删除。 Title: Non-ANSI style left outer join is discontinued and has been removed.
类别:警告Category: Warning

描述 Description
Azure SQL 数据库中已弃用非 ANSI 样式左外部联接并且已将其删除。Non-ANSI style left outer join is discontinued and has been removed in Azure SQL Database.

建议 Recommendation
使用 ANSI 联接语法。Use ANSI join syntax.

有关详细信息,请参阅 SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine functionality in SQL Server

非 ANSI 右外部联接Non-ANSI right outer join

标题:非 ANSI 样式右外部联接已弃用,并且已被删除。 Title: Non-ANSI style right outer join is discontinued and has been removed.
类别:警告Category: Warning

描述 Description
Azure SQL 数据库中已弃用非 ANSI 样式右外部联接并且已将其删除。Non-ANSI style right outer join is discontinued and has been removed in Azure SQL Database.

建议 Recommendation
使用 ANSI 联接语法。Use ANSI join syntax.

有关详细信息,请参阅 SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine functionality in SQL Server

Next 列Next column

标题:名为 NEXT 的表和列将导致 Azure SQL 数据库发生错误。 Title: Tables and Columns named NEXT will lead to an error In Azure SQL Database.
类别:问题Category: Issue

描述 Description
检测到名为 NEXT 的表或列。Tables or columns named NEXT were detected. Microsoft SQL Server 中引入的序列使用 ANSI 标准 NEXT VALUE FOR 功能。Sequences, introduced in Microsoft SQL Server, use the ANSI standard NEXT VALUE FOR function. 如果表或列名为 NEXT 且该列的别名为 VALUE,在省略 ANSI 标准 AS 的情况下,所得到的语句可能会导致错误。If a table or a column is named NEXT and the column is aliased as VALUE, and if the ANSI standard AS is omitted, the resulting statement can cause an error.

建议 Recommendation
在设置表或列的别名时重写语句以包含 ANSI 标准 AS 关键字。Rewrite statements to include the ANSI standard AS keyword when aliasing a table or column. 例如,当列名为 NEXT 且该列的别名为 VALUE 时,查询 SELECT NEXT VALUE FROM TABLE 将导致发生错误,应将其重写为 SELECT NEXT AS VALUE FROM TABLE。For example, when a column is named NEXT and that column is aliased as VALUE, the query SELECT NEXT VALUE FROM TABLE will cause an error and should be rewritten as SELECT NEXT AS VALUE FROM TABLE. 同样,如果表名为 NEXT 且该表的别名为 VALUE,则查询 SELECT Col1 FROM NEXT VALUE 将导致发生错误,应将其重写为 SELECT Col1 FROM NEXT AS VALUESimilarly, when a table is named NEXT and that table is aliased as VALUE, the query SELECT Col1 FROM NEXT VALUE will cause an error and should be rewritten as SELECT Col1 FROM NEXT AS VALUE.

RAISERRORRAISERROR

标题:应将旧式的 RAISERROR 调用替换为等效的新式调用。 Title: Legacy style RAISERROR calls should be replaced with modern equivalents.
类别:警告Category: Warning

描述 Description
类似于以下示例的 RAISERROR 调用称为旧式,因为它们不包含逗号和括号。RAISERROR calls like the below example are termed as legacy-style because they do not include the commas and the parenthesis. RAISERROR 50001 'this is a test'.RAISERROR 50001 'this is a test'. Azure SQL 数据库已弃用 RAISERROR 的这种调用方法并已将其删除。This method of calling RAISERROR is discontinued and removed in Azure SQL Database.

建议 Recommendation
使用当前的 RAISERROR 语法重写该语句,或评估 BEGIN TRY { } END TRY BEGIN CATCH { THROW; } END CATCH 的新式方法是否可行。Rewrite the statement using the current RAISERROR syntax, or evaluate if the modern approach of BEGIN TRY { } END TRY BEGIN CATCH { THROW; } END CATCH is feasible.

有关详细信息,请参阅 SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine functionality in SQL Server

服务器审核Server audits

标题:使用 Azure SQL 数据库审核功能替换服务器审核 Title: Use Azure SQL Database audit features to replace Server Audits
类别:警告Category: Warning

描述 Description
Azure SQL 数据库不支持服务器审核功能。Server Audits is not supported in Azure SQL Database.

建议 Recommendation
请考虑使用 Azure SQL 数据库审核功能替代服务器审核。Consider Azure SQL Database audit features to replace Server Audits. Azure SQL 支持审核功能,并且该功能比 SQL Server 的功能更强大。Azure SQL supports audit and the features are richer than SQL Server. Azure SQL 数据库可以审核各种数据库操作和事件,包括:对数据的访问、架构更改 (DDL)、数据更改 (DML)、帐户、角色和权限 (DCL)、安全异常。Azure SQL database can audit various database actions and events, including: Access to data, Schema changes (DDL), Data changes (DML), Accounts, roles, and permissions (DCL, Security exceptions. Azure SQL 数据库审核功能可提高组织深入了解数据库中发生的事件和更改(包括针对数据的更新和查询)的能力。Azure SQL Database Auditing increases an organization's ability to gain deep insight into events and changes that occur within their database, including updates and queries against the data. 或者,迁移到 Azure SQL 托管实例或 Azure 虚拟机上的 SQL Server。Alternatively migrate to Azure SQL Managed Instance or SQL Server on Azure Virtual Machine.

有关详细信息,请参阅 Azure SQL 数据库的审核功能More information: Auditing for Azure SQL Database

服务器凭据Server credentials

标题:Azure SQL 数据库不支持服务器范围的凭据 Title: Server scoped credential is not supported in Azure SQL Database
类别:警告Category: Warning

描述 Description
凭据是包含连接到 SQL Server 外部资源所需的身份验证信息(凭据)的记录。A credential is a record that contains the authentication information (credentials) required to connect to a resource outside SQL Server. Azure SQL 数据库支持数据库凭据,但不支持在 SQL Server 范围创建的凭据。Azure SQL Database supports database credentials, but not the ones created at the SQL Server scope.

建议 Recommendation
Azure SQL 数据库支持数据库范围的凭据。Azure SQL Database supports database scoped credentials. 将服务器范围的凭据转换为数据库范围的凭据。Convert server scoped credentials to database scoped credentials. 或者,迁移到 Azure SQL 托管实例或 Azure 虚拟机上的 SQL ServerAlternatively migrate to Azure SQL Managed Instance or SQL Server on Azure Virtual Machine

有关详细信息,请参阅创建数据库范围的凭据More information: Creating database scoped credential

Service BrokerService Broker

标题:Azure SQL 数据库不支持 Service Broker 功能 Title: Service Broker feature is not supported in Azure SQL Database
类别:问题Category: Issue

描述 Description
SQL Server Service Broker 在 SQL Server 数据库引擎中为消息传递和队列应用程序提供本机支持。SQL Server Service Broker provides native support for messaging and queuing applications in the SQL Server Database Engine. Azure SQL 数据库不支持 Service Broker 功能。Service Broker feature is not supported in Azure SQL Database.

建议 Recommendation
Azure SQL 数据库不支持 Service Broker 功能。Service Broker feature is not supported in Azure SQL Database. 请考虑迁移到在同一实例中支持 Service Broker 的 Azure SQL 托管实例。Consider migrating to Azure SQL Managed Instance that supports service broker within the same instance. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

服务器范围的触发器Server-scoped triggers

标题:Azure SQL 数据库不支持服务器范围的触发器 Title: Server-scoped trigger is not supported in Azure SQL Database
类别:警告Category: Warning

描述 Description
触发器是一种特殊的存储过程,用户可执行它来响应表中的特定操作,例如插入、删除或更新数据。A trigger is a special kind of stored procedure that executes in response to certain action on a table like insertion, deletion, or updating of data. Azure SQL 数据库不支持服务器范围的触发器。Server-scoped triggers are not supported in Azure SQL Database. Azure SQL 数据库不支持以下触发器选项:FOR LOGON、ENCRYPTION、WITH APPEND、NOT FOR REPLICATION、EXTERNAL NAME 选项(没有外部方法支持)、ALL SERVER 选项(DDL 触发器)、LOGON 事件触发器(登录触发器),Azure SQL 数据库不支持 CLR 触发器。Azure SQL Database does not support the following options for triggers: FOR LOGON, ENCRYPTION, WITH APPEND, NOT FOR REPLICATION, EXTERNAL NAME option (there is no external method support), ALL SERVER Option (DDL Trigger), Trigger on a LOGON event (Logon Trigger), Azure SQL Database does not support CLR-triggers.

建议 Recommendation
请改为使用数据库级别触发器。Use database level trigger instead. 或者,迁移到 Azure SQL 托管实例或 Azure 虚拟机上的 SQL ServerAlternatively migrate to Azure SQL Managed Instance or SQL Server on Azure Virtual Machine

有关详细信息,请参阅解析迁移到 SQL 数据库的过程中的 Transact-SQL 差异More information: Resolving Transact-SQL differences during migration to SQL Database

SQL 代理作业SQL Agent jobs

标题:SQL Server 代理作业在 Azure SQL 数据库中不可用。 Title: SQL Server Agent jobs are not available in Azure SQL Database
类别:警告Category: Warning

描述 Description
SQL Server 代理是一项 Microsoft Windows 服务,它在执行计划的管理任务,这些任务 SQL Server 中被称为“作业”。SQL Server Agent is a Microsoft Windows service that executes scheduled administrative tasks, which are called jobs in SQL Server. SQL Server 代理作业在 Azure SQL 数据库中不可用。SQL Server Agent jobs are not available in Azure SQL Database.

建议 使用弹性作业(预览版),这是 Azure SQL 数据库中 SQL Server 代理作业的替代项。Recommendation Use elastic jobs (preview), which are the replacement for SQL Server Agent jobs in Azure SQL Database. 使用 Azure SQL 数据库的弹性数据库作业,可以跨多个数据库可靠执行 T-SQL 脚本,同时自动重试并提供最终完成保证。Elastic Database jobs for Azure SQL Database allow you to reliably execute T-SQL scripts that span multiple databases while automatically retrying and providing eventual completion guarantees. 或者,请考虑迁移到 Azure SQL 托管实例或 Azure 虚拟机上的 SQL Server。Alternatively consider migrating to Azure SQL Managed Instance or SQL Server on Azure Virtual Machines.

有关详细信息,请参阅弹性数据库作业(预览版)入门More information: Getting started with Elastic Database jobs (Preview)

SQL 数据库大小SQL Database size

标题:Azure SQL 数据库不支持超过 100 TB 的数据库大小。 Title: Azure SQL Database does not support database size greater than 100 TB.
类别:问题Category: Issue

描述 Description
数据库的大小大于支持的最大大小 100 TB。The size of the database is greater than the maximum supported size of 100 TB.

建议 Recommendation
评估数据是否可以存档、压缩或分片到多个数据库中。Evaluate if the data can be archived or compressed or sharded into multiple databases. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

有关详细信息,请参阅 vCore 资源限制More information: vCore resource limits

SQL MailSQL Mail

标题:SQL Mail 已弃用。 Title: SQL Mail has been discontinued.
类别:警告Category: Warning

描述 Description
Azure SQL 数据库已弃用 SQL Mail 并已将其删除。SQL Mail has been discontinued and removed in Azure SQL Database.

建议 Recommendation
请考虑迁移到 Azure SQL 托管实例或 Azure 虚拟机上的 SQL Server 并使用数据库邮件。Consider migrating to Azure SQL Managed Instance or SQL Server on Azure Virtual Machines and use Database Mail.

有关详细信息,请参阅 SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine functionality in SQL Server

SystemProcedures110SystemProcedures110

标题:检测到引用已删除的系统存储过程的语句,这些系统存储过程在 Azure SQL 数据库中不可用。 Title: Detected statements that reference removed system stored procedures that are not available in Azure SQL Database.
类别:警告Category: Warning

描述 Description
今后不能在 Azure SQL 数据库中使用不受支持的系统存储过程和扩展存储过程 - sp_dboptionsp_addserversp_dropaliassp_activedirectory_objsp_activedirectory_scpsp_activedirectory_startFollowing unsupported system and extended stored procedures cannot be used in Azure SQL database - sp_dboption, sp_addserver, sp_dropalias,sp_activedirectory_obj, sp_activedirectory_scp, sp_activedirectory_start.

建议 Recommendation
删除对不受支持并且已从 Azure SQL 数据库中删除的系统存储过程的引用。Remove references to unsupported system procedures that have been removed in Azure SQL Database.

有关详细信息,请参阅 SQL Server 中弃用的数据库引擎功能More information: Discontinued Database Engine functionality in SQL Server

跟踪标志Trace flags

标题:Azure SQL 数据库不支持跟踪标志 Title: Azure SQL Database does not support trace flags
类别:警告Category: Warning

描述 Description
跟踪标志用于临时设置特定服务器的特征或关闭特定行为。Trace flags are used to temporarily set specific server characteristics or to switch off a particular behavior. 跟踪标志经常用于诊断性能问题,或调试存储过程或复杂的计算机系统。Trace flags are frequently used to diagnose performance issues or to debug stored procedures or complex computer systems. Azure SQL 数据库不支持跟踪标志。Azure SQL Database does not support trace flags.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看 Azure SQL 数据库不支持的所有跟踪标志,并评估是否可以删除这些跟踪标志。Review impacted objects section in Azure Migrate to see all trace flags that are not supported in Azure SQL Database and evaluate if they can be removed. 或者,迁移到支持有限数量的全局跟踪标志或 Azure 虚拟机上的 SQL Server 的 Azure SQL 托管实例。Alternatively, migrate to Azure SQL Managed Instance which supports limited number of global trace flags or SQL Server on Azure Virtual Machine.

有关详细信息,请参阅解析迁移到 SQL 数据库的过程中的 Transact-SQL 差异More information: Resolving Transact-SQL differences during migration to SQL Database

Windows 身份验证Windows authentication

标题:通过 Windows 身份验证映射的数据库用户(集成安全性)在 Azure SQL 数据库中不受支持。 Title: Database users mapped with Windows authentication (integrated security) are not supported in Azure SQL Database.
类别:警告Category: Warning

描述 Description
Azure SQL 数据库支持两种类型的身份验证Azure SQL Database supports two types of authentication

  • SQL 身份验证:使用用户名和密码SQL Authentication: uses a username and password
  • Azure Active Directory 身份验证:使用 Azure Active Directory 管理的标识,支持托管域和集成域。Azure Active Directory Authentication: uses identities managed by Azure Active Directory and is supported for managed and integrated domains.

通过 Windows 身份验证映射的数据库用户(集成安全性)在 Azure SQL 数据库中不受支持。Database users mapped with Windows authentication (integrated security) are not supported in Azure SQL Database.

建议 Recommendation
将本地 Active Directory 与 Azure Active Directory 联合。Federate the local Active Directory with Azure Active Directory. 然后,可以将 Windows 标识替换为等效的 Azure Active Directory 标识。The Windows identity can then be replaced with the equivalent Azure Active Directory identities. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

有关详细信息,请参阅 SQL 数据库安全功能More information: SQL Database security capabilities

XP_cmdshellXP_cmdshell

标题:xp_cmdshell 在 Azure SQL 数据库中不受支持。 Title: xp_cmdshell is not supported in Azure SQL Database.
类别:问题Category: Issue

描述 Description
xp_cmdshell 会生成 Windows 命令 shell 并传入要执行的字符串,它在 Azure SQL 数据库中不受支持。xp_cmdshell which spawns a Windows command shell and passes in a string for execution is not supported in Azure SQL Database.

建议 Recommendation
检查 Azure Migrate 中的“受影响的对象”部分,查看所有使用 xp_cmdshell 的作业,并评估是否可以删除对 xp_cmdshell 的引用或受影响的对象。Review impacted objects section in Azure Migrate to see all objects using xp_cmdshell and evaluate if the reference to xp_cmdshell or the impacted object can be removed. 另请考虑了解 Azure 自动化,它提供基于云的自动化和配置服务。Also consider exploring Azure Automation that delivers cloud-based automation and configuration service. 或者,迁移到 Azure 虚拟机上的 SQL Server。Alternatively, migrate to SQL Server on Azure Virtual Machine.

后续步骤Next steps

若要开始将 SQL Server 迁移到 Azure SQL 数据库,请参阅 SQL Server 到 SQL 托管实例迁移指南To start migrating your SQL Server to Azure SQL Database, see the SQL Server to SQL Database migration guide.