I am having issues with doing a BCP OUT/IN on an recreated table.
I have table that have millions of records and I am hoping to BCP OUT the records, recreate the table, and do a BCP IN. My commands are simply:
BCP DBServer.dbo.myTable OUT myFlatFile.out -T -n
Consequently, the BCP IN:
BCP DBServer.dbo.myTable IN myFlatFile.out -T -n -E
Now, my problem is on the BCP in. Oh, when i recreate the table, one of the column becomes a not nullable column, wherein originally it was. However, that column are all populated. But the problem that occurs when i BCP in it is that, there's an error that the data is truncated and thus, nothing gets imported.
When i try to recreate the table and leave that column as NULLABLE, the data gets imported fine. However, I am intending to use that column as part of the PRIMARY KEY and thus, it needs to be NOT NULL during the create. What can I do to be able to import this data to the newly created table?
Thank you very much for any assistance.