Share via

Encountered an error while migrating the sql db server to azure sql using DMA

Punith K M 0 Reputation points
2023-09-08T06:41:50.68+00:00

I have encountered a issue while migrating the db server to azure. I got following error while migrating

An unexpected error occurred. Failed to migrate data from source database 'AdventureWorks2019' to target database 'databasemigrate'. The pipeline failed to write a data range batch for table databasemigrate.Person.Address. The pipeline failed to write a batch to table databasemigrate.Person.Address. The SQL query was SELECT "AddressID", "AddressLine1", "AddressLine2", "City", "StateProvinceID", "PostalCode", "SpatialLocation", "rowguid", "ModifiedDate" FROM "AdventureWorks2019"."Person"."Address" ORDER BY "AddressID" ASC Unable to cast object of type 'System.DBNull' to type 'System.Type'.

Azure SQL Database

1 answer

Sort by: Most helpful
  1. SSingh-MSFT 16,461 Reputation points Moderator
    2023-09-08T10:39:16.1733333+00:00

    Hi Punith K M,

    Welcome to Microsoft Q&A forum and thanks for using Azure Services.

    As I understand, you are getting error when migrating SQL DB Server to Azure SQL using DMA.

    Could you please check if at the source level one of the columns holds NULLs?

    Also refer to https://stackoverflow.com/questions/870697/unable-to-cast-object-of-type-system-dbnull-to-type-system-string thread which might help in your case.

    Thanks

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.