Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Error handling in Bulk Insert Job. Error Message truncated

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-12-16 : 08:14:18
Rishi writes "Hi,

I am running a job which bulk inserts files from a folder. I came across your solution http://www.sqlteam.com/item.asp?ItemID=2290 (Error handling in long running jobs) and found it suitable for my scenario as I was not able to catch the bulk insert error and the job used to stop at the first error itself.
My problem now is that the error is logged in a table but it gets truncated.I am catching the error message as returned by "sp_OAGetErrorInfo" in a local variable with data type varchar(8000). Since this is the max one can give to a varchar and one cannot use text as a local variable I am lost as how to catch the complete error message.In my case, the bulk insert file may have errors in multiple lines, I wish to catch all of them (as returned by bulk insert statement in T-SQL) but maybe because of the length of 8000 the error message is being truncated.
Please help me here and provide a solution, an alternate solution, as to catch the complete message.

Looking forward to hearing from you.
Thanks"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-19 : 01:19:18
Refer this also
http://www.sommarskog.se/error-handling-I.html

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -