February 27, 2015 at 12:01 am
Hi There,
how to fetch records which throws error?
For example
I'm inserting records from a table to another table, having multiple columns
SampleQuery :
insert into tableB (col1,col2....col10)
select col1,col2....col10 from tableA
* while executing this query im getting error. (like varchar cant convert to numberic)
* Here I have no clue in which column it is
* also dont know which row causes it
How to fix this?
February 27, 2015 at 12:08 am
Some days, it helps if you think before typing...
you could do it in batches and use a TRY CATCH block for the failure, and write the failed group of records to another table...
February 27, 2015 at 12:13 am
pietlinden (2/27/2015)
Some days, it helps if you think before typing...you could do it in batches and use a TRY CATCH block for the failure, and write the failed group of records to another table...
Im currently doing that. But I wonder is there any features in sql to do so.
February 27, 2015 at 4:57 am
* while executing this query im getting error. (like varchar cant convert to numberic)
* Here I have no clue in which column it is
* also dont know which row causes it
That error message gives you a strong clue: your source column is varchar() and your destination is numeric(). Start checking datatypes and make sure that they match – or that you explicitly handle the conversions in your source query.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy