Altering the type of a column from a table that was imported as a CSV file, but it's causing all the values to reset to blanks.

What happens if you try to do a normal import without data alterations inline? A common paradigm is to import the data as raw as you can into a 'staging' schema of your db. Then you can write your transformation scripts converting the data from your 'staging' layer to your 'transformed' layer. This also lets you troubleshoot if your issues are due to your transformation scripts or if there's a problem with the underlying data import.

Like others have said, it may be an issue with newline chars or quotes. If you have comment fields or open text fields, the escape chars can really fuck up the interpretation.

Are the blanks consistent across the whole column?

/r/SQL Thread