---
title: "Troubleshooting Data Import (DBA Tool)"
canonical: "https://servicedesk.maxgeo.com/space/LC/1263632517/Troubleshooting%20Data%20Import%20(DBA%20Tool)"
format: markdown
---
<u>**Problem:**</u>

1. The import failed, and I received the error:
  - "BulkCopy from Table Error: Colum X does not allow DBNull.Value." - refer **Cause 1**, noting that X is a reference to a column header in the top table.
  - "Label error:Input string was not in a correct format.Couldn't store <Y> in <X> Column.  Expected type is Int32." - refer **Cause 2**, noting that X is a reference to a column header in the top table, and Y is a reference to a value you have tried to import.
  - "BulkCopy to Table Error: Violation of PRIMARY KEY constraint 'V'. Cannot insert duplicate key in object 'Z'.  The duplicate key value is (U)." - refer **Cause 3**, noting that V is reference to a specific Primary Key configuration, Z is the database table you are attempting to import data to and U is the combination of values that are trying to import that is not complying with the Primary Key requirement.

<u>**Troubleshooting:**</u>

<u>**Cause:**</u>

1. If you hover the mouse over the various columns in the top table, you will see that some contain "Cannot be null".  These fields must be populated with data.  Some are auto-populated by the system, but not all.  Refer **Solution 1**.
2. The database contains a lot of 'libraries'.  These means that for each of the values you see in the software (for example: "Active" as Lease Type) these correspond first to a library (e.g. "Lease Status" or, as it is known in the database, "TenementStatus") and secondly to a number value (e.g. 3).  What the system is expecting is the number value, and you have provided instead (usually) text.  Refer **Solution 2**.
3. LeaseControl has built with constraints matching user requirements, such as preventing data conflicts.  A 'Primary Key' (in short) is required to be unique, and may either compiled from field or combination of fields.  In this case, the data you have imported as resulted in a Primary Key that is not unique per row of data (perhaps conficting with data already in the table).  Refer **Solution 3**.

<u>**Solution:**</u>

1. Roll your mouse over each of the headers in the top table, and look for those saying "Cannot be null".  Ensure that you have supplied data for each of these fields - in particular, the one referred to in your error.
2. Right-click the relevant header in the bottom row, and select "Translate".  The system will reconcile your text to the relevant library, and return the numerical value.  If your text does not appear in the library you will be provided an error.
3. Correct the data such that it is unique (hovering your mouse over each header in the top table and look for "PRIMARY KEY"), however you may wish to contact servicedesk.maxgeo.com for assistance in ensuring you are importing the correct data to the relevant table, and that you are correctly identifying that field, or combination of fields, that are required to be unique.