bcp command | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

bcp command

I am using the bcp command to export a text file into the database, bcp elearning.dbo.BulkData in mobile.txt -c -t, -SZOHL-02 -Usa -P1234567890 -E I have 6 fields in the table to which i am exporting data.
One field is numeric and i have to set the identity to yes,
It gives me an error string data trucncated. When i remove the identity field, i am able to export data.So, how do i tackle this prob?
I used the -E attribute to keep the identity
I am using sqls erver 2000
BOL states If the data file does not contain values for the identity column in the table or view, use a format file to specify that the identity column in the table or view should be skipped when importing data; SQL Server 2000 automatically assigns unique values for the column. So try with formatfile option. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>