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)
 Record Column which is causing exception

Author  Topic 

chintanpshah
Starting Member

5 Posts

Posted - 2010-03-19 : 09:02:36
Hi,

I am writing queries with CONVERT function. I have more than 200 columns in query. I am processing each row and write it to file.

I need to log all errors occured during process. I need to capture column which is causing exception (Arithmetic overflow error converting numeric to data type varchar.) and log it in other file and send to administrator.

How can I get Column which is causing exception?

Thanks in advance...

Chintan Shah
Software Engineer

chintanpshah
Starting Member

5 Posts

Posted - 2010-03-20 : 02:04:14
Anyone?

Chintan Shah
Software Engineer
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-20 : 03:27:38
the best way to do this is to check the lengths of source fields against your convertion statement and check if you've specified correct lengths to hold values coming. Also I assume you're not doing any aggregations inside in which your convertion staetement should have a precision greater than that of source length

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

chintanpshah
Starting Member

5 Posts

Posted - 2010-03-20 : 03:51:45
Can you please look at http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=141735? I have tried another method, but not working properly.

Chintan Shah
Software Engineer
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-20 : 11:47:19
quote:
Originally posted by chintanpshah

Can you please look at http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=141735? I have tried another method, but not working properly.

Chintan Shah
Software Engineer


That thread got locked i guess

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-20 : 14:30:09
Remove the ? from the link. The Snitz software didn't do the url correct.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -