I have a humongous view of some 236 columns, containing atleast 500'000 rows. If I do a simple SELECT * FROM VIEW, I get a arithmetic overflow at some point, and the SELECT aborts.
I know exactly why- in some row and column, the CAST(COL AS DECIMAL(x,y)) fails, which is caused by a number which is too big to fit the restrictions posed by the casting. I need to identify that exact row and column, and I'm looking to find a automated way to find the data that causes this.
Is this possible somehow to do in some automated way? As the brute force way, is a bit too exhaustive, as I have to go through the relevant columns (about 80 columns are being casted to decimal), and afterwards finding the exact row, for which I haven't developed a method for yet. I can't "see" the row, as it fails, thus never displays.
The view is on SQL Server 2008 R2.