monkeylizard
MIS
I have an export from a 3rd party application in a tab delimited format. The exported file is flat text, tab delimited, and was designed to be fairly generic for importing into a DB (SQL, DB2, Oracle, etc). One field in the export is text. According to the app's documentation, the destination field in the DB should be nvarchar(255). Apparently that same restriction on size is not in the app's export process.
The app came with some scripts (.bat) to load the export files to the SQL db via BCP commands. During some imports, I'm receiving String data, right truncation in the error logs and it skips the record(s) with values > 255 in length.
I really don't care about it truncating. That would be just fine in this case if it would truncate at 255, but it doesn't. It skips the record.
Here's the command their script executes:
I have also tried adding the -n option, but that didn't help. I didn't think it would.
My question is: Is there a way to force BCP to actually do the truncating instead of warning about the truncation?
Monkeylizard
Sometimes just a few hours of trial and error debugging can save minutes of reading manuals.
The app came with some scripts (.bat) to load the export files to the SQL db via BCP commands. During some imports, I'm receiving String data, right truncation in the error logs and it skips the record(s) with values > 255 in length.
I really don't care about it truncating. That would be just fine in this case if it would truncate at 255, but it doesn't. It skips the record.
Here's the command their script executes:
Code:
bcp TLWEB.dbo.TLWEB_SESSION in C:\TL\Export\loading\BulkSession.txt %BCPOPTIONS% -S SERVER1 -e C:\TL\Export\error\BulkSession.txt -f C:\TL\Script\Session.fmt >> %LOGFILESES% 2>&1
I have also tried adding the -n option, but that didn't help. I didn't think it would.
My question is: Is there a way to force BCP to actually do the truncating instead of warning about the truncation?
Monkeylizard
Sometimes just a few hours of trial and error debugging can save minutes of reading manuals.