Retrieving column name for the Error Code.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ananth
    New Member
    • Nov 2006
    • 75

    #1

    Retrieving column name for the Error Code.

    Hi All,
    I am getting an SQL Error Inserted Value to LARGE FOR COLUMN .I know the cause for this error

    Is there any specific error handling method where in i can find for which column the error occurs using an sql query,procedure or functions

    Ex:I have a table named emp which contains 150 columns.When i use insert query to insert values.I get an error message INSERTED VALUE TO LARGE FOR COLUMNS.

    I found out manually which column the error occurs but is there any other way to retrieve the column name using sql query.

    Pls help me in this regard???

    Thanks in Advance!!!!!
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by ananth
    Hi All,
    I am getting an SQL Error Inserted Value to LARGE FOR COLUMN .I know the cause for this error

    Is there any specific error handling method where in i can find for which column the error occurs using an sql query,procedure or functions

    Ex:I have a table named emp which contains 150 columns.When i use insert query to insert values.I get an error message INSERTED VALUE TO LARGE FOR COLUMNS.

    I found out manually which column the error occurs but is there any other way to retrieve the column name using sql query.

    Pls help me in this regard???

    Thanks in Advance!!!!!
    Create a Procedure and execute this insert statement within the procedure.
    Implement an EXCEPTION block and when any exception occurs you can print the data that is causing the problem.

    But finding a column name would not be possible. Only the data can be found this way that is causing the problem!!

    Comment

    Working...