Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error SQL71501 on exporting Azure SQL Database

I'm getting a strange error when exporting an Azure SQL Database. Exports had been working fine until some recent schema changes, but it's now giving me Error SQL71501.

The database is V12, Compatibility Level 130 (although the master database is still Compatibility Level 120).

The problem seems to be caused by a new table-valued function, which uses the built in STRING_SPLIT function. There were already stored procedures using STRING_SPLIT and they don't seem to have affected the export, but the function (which compiles OK, and is working fine) seems to cause a problem with the export.

The function below is a simplified version of the real one, but causes the same problem.

CREATE FUNCTION [dbo].[TestFunction](
    @CommaSeparatedValues VARCHAR(MAX)
)
RETURNS TABLE
AS
    RETURN

    SELECT      c.ClientId,
                c.FullName

    FROM        dbo.Client c

    INNER JOIN  STRING_SPLIT(@CommaSeparatedValues, ',') csv
    ON          c.ClientId = csv.value

The complete error message given in the Import/Export history blade is as follows:

Error encountered during the service operation.

One or more unsupported elements were found in the schema used as part of a data package.

Error SQL71501: Error validating element [dbo].[TestFunction]: Function: [dbo].[TestFunction] has an unresolved reference to object [dbo].[STRING_SPLIT].

Error SQL71501: Error validating element [dbo].[TestFunction]: Function: [dbo].[TestFunction] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [dbo].[Client].[csv], [dbo].[STRING_SPLIT].[csv] or [dbo].[STRING_SPLIT].[value].

like image 313
Jonathan Sayce Avatar asked Oct 18 '16 13:10

Jonathan Sayce


People also ask

What is sql71501 error in Azure SQL Server?

Error SQL71501: Error validating element [TaskHosting]: Schema: [TaskHosting] has an unresolved reference to object [##MS_SyncAccount##]. Error SQL71626: The element Certificate: [DataSyncEncryptionCertificate_fa663c125b524e59bab795096082bc13] is not supported in Microsoft Azure SQL Database v12.

Why can’t i export data from Azure SQL data sync?

This occurs when Azure SQL Data Sync was used on the database to sync with another database. The remnants from the DSS schema used by SQL Data Sync do not allow to export the database due to inconsistencies.

What is sql71501 error validating element [taskhosting]?

Error SQL71501: Error validating element [TaskHosting]: Schema: [TaskHosting] has an unresolved reference to object [##MS_SyncAccount##]. Show activity on this post. This occurs when Azure SQL Data Sync was used on the database to sync with another database.

What is this error sql71562?

Error SQL71562: Error validating element (and a partial listing of objects follows). When moving from on-premises to Azure there were things that had to been done regarding database tables and stored procedures to ensure a successful bacpac creation.


1 Answers

This is Xiaochen from Microsoft SQL team. We are already working on the fix of this issue. The fix will be deployed to the export service in next few weeks. In the same time, the fix is already available in the latest DacFX 16.4 (https://blogs.msdn.microsoft.com/ssdt/2016/09/20/sql-server-data-tools-16-4-release/). Before we fix this issue in the service, you can download the DacFX 16.4 and use sqlpackage to work around.

like image 113
Wu Xiaochen Avatar answered Oct 05 '22 23:10

Wu Xiaochen