SamJolly
SamJolly

Reputation: 6477

Trying to export Azure SQL DB - get strange VARBINARY(MAX) error... none in DB

Recently I have been unable to export my SQL Azure DB within the same subscription and data centre.

The error I get is:

"Error encountered during the service operation. Could not export schema and data from database. One or more errors occurred. One or more errors occurred. One or more errors occurred. One or more errors occurred. One or more errors occurred. varbinary column at ordinal 65 should be preceded by DATALENGTH(col) in the SqlDataReader supplied."

There are no VARBINARY columns in the DB. I have checked this using:

SELECT table_name [Table Name], column_name [Column Name]
FROM information_schema.columns where data_type = 'VARBINARY' 

The only significant change is that I am using the encrypted column type (deterministic) for some columns. Would this prevent an export and produce this type of error?

At present I am unable to export. I can copy a DB however.

I would appreciate any advice please.

EDIT

On further research, I feel the encrypted columns are preventing the export, as having removed the encryption from all columns, I am now able to export the DB. I am now trying this via SSMS's "Export Data Tier" feature. I have also raised this with MS. Still ongoing.

EDIT2

I have diagnosed that the cause of my problem is the use of VARCHAR(8000) instead of VARCHAR(MAX) as the data type for the encrypted column. Hoping not to need to change these types to VARCHAR(MAX).

Upvotes: 2

Views: 708

Answers (1)

Alberto Morillo
Alberto Morillo

Reputation: 15648

Currently Sql Serializer does not support nvarchar column with length 4000 on encrypted column. That is the reason you are receiving that error. I have received information that this limitation is going to be removed.

Upvotes: 1

Related Questions