I'm using SQL Server 2008 R2. I have 2 tables old
and new
and about 500k rows.
I need to convert data from old
to new
. Some columns were changed. For example in old
table many columns are of type varchar
and in new
table int
.
I'm executing query like this:
INSERT INTO new (xxx)
SELECT FROM old (yyy)
And get following error:
Msg 245, Level 16, State 1, Line 4
Conversion failed when converting the nvarchar value 'Tammi ' to data type int.
This error shows, that in old
table are some rows with wrong data in columns. (Human factor).
But how can I find these wrong rows? Is it possible?
How can I find in what column wrong data is present?