SQL Server Performance Forum – Threads Archive
bcp question
I have used bcp and bulk insert to load my table. They both work, however, they only load half of the data. If I use DTS all of the data is loaded. Can someone tell me why this might be happening? lca234Any error in SQL log and/or Event W.
Luis Martin
Moderator
SQL-Server-Performance.com One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important
Bertrand Russell
All postings are provided “AS IS†with no warranties for accuracy.
Luis,
I’m sorry. I’m very new to SQL Server, but as far as I can tell there are no errors in the SQL log. What is Event W though? If you can tell me I will check it. andy
Go to control panel/admin tools/event viewer and see application log thats what he means by event W. Check for any errors there.
Rajesh
Andy
Post the query where BCP & BULK INSERT statements are used and for SQL error log refer under Enterprise Manager –> Management –> SQL Server error logs and refer first log. 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.
Satya
Here is the bulk insert statement and the bcp that I am using. I’m running them locally on the server. BULK INSERT Policy_DB..crop_policy
FROM ‘G:RMAPOLLOADcrop_policy.unl’
WITH
(
FORMATFILE = ‘G:RMAPOLLOADcrop_policy.fmt’
)
The bcp statement is in a batch file that I call from a C# program (I’m very new to C# also). bcp policy_db..crop_policy in crop_policy.unl -m10000 -fcrop_policy.fmt -ecrop_policy.err
-Smyservername -Pmypassword
I just reran the bulk insert and then I checked the Sql server log and there were no errors. I can’t see the event viewer on our server. I don’t think the organization I’m working for gave me the permission to see it. I can check it on my machine (there were no errors), but I don’t know if my machine would have an error since the insert is being run on the server. Andy
Use bcp THEN use BULK insert.<br /><br /><br />The two halves will then make a whole.<br /><br /><br /><br /><br /><br /><img src=’/community/emoticons/emotion-5.gif’ alt=’

As the BCP is called from C# program it may be bit tricky to collec the results, you may try PROFILER to see underline events and also try to capture errors in c# program. I don’t see anything wrong on the statements and ensure the formatfile has been equipped with all the column details in order. 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.
Sorry everyone. I’m in the middle of testing and I had to put this question on hold. I’ll probably re-post the question later if I haven’t found an answer. Thank you for all your help. Andy
]]>