Sql Server 2019 Import Export Wizard Unable to cast object of type system.dbnull
Binway
716
Reputation points
I am using the Sql Server 2019 Import export wizard to copy data from 16 tables in an Azure Sql Server Database to another Azure sql database in the same subscription, resource group etc. The wizard works fine for a table or two sometimes but when it fails or I select multiple tables I get this error:
- Setting Destination Connection (Error)
Messages
Error 0xc0047062: Destination - CapitalWork [97]: System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.Type'.
at Microsoft.SqlServer.Dts.Pipeline.ADONETDestination.SetMetadataValsFromRow(DataRow currRow, String& name, Int32& codePage, Int32& length, Int32& precision, Int32& scale, DataType& dtsType)
at Microsoft.SqlServer.Dts.Pipeline.ADONETDestination.SetExternalMetadataInfos(IDTSExternalMetadataColumnCollection100 iDTSExtCols, DataTable metadataTbl)
at Microsoft.SqlServer.Dts.Pipeline.ADONETDestination.ReinitializeMetaData()
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostReinitializeMetaData(IDTSManagedComponentWrapper100 wrapper) (SQL Server Import and Export Wizard)
Unable to cast object of type 'System.DBNull' to type 'System.Type'. (Microsoft.SqlServer.DTSPipelineWrap)
The tables have a range of record counts from 1 million down to 1, the million record table works fine when activated by itself.
Thanks
Sign in to answer