Renaming a column, appears to cause data to be lost
Brian Donahue
Posts: 6,590 Bronze 1
Hello,
In some circumstances the Packager needs to drop the table and re-create it where it would normally just alter it. I believe that changing the datatype may be one of these circumstances.
The Packager should be inserting the data from the original table into a temporary one before renaming it. There is a chance of losing data if the column name itself is being changed. SQL Packager will try to guess if a column is being renamed by comparing the names between the original table and the modified table and looking for similarities, but there still is a strong chance that the data would be lost.
The best thing I can suggest is to have a look at the SQL schama script that Packager is producing and making sure that the data is being inserted into the new table.
In some circumstances the Packager needs to drop the table and re-create it where it would normally just alter it. I believe that changing the datatype may be one of these circumstances.
The Packager should be inserting the data from the original table into a temporary one before renaming it. There is a chance of losing data if the column name itself is being changed. SQL Packager will try to guess if a column is being renamed by comparing the names between the original table and the modified table and looking for similarities, but there still is a strong chance that the data would be lost.
The best thing I can suggest is to have a look at the SQL schama script that Packager is producing and making sure that the data is being inserted into the new table.
This discussion has been closed.