Home Forums SQL Server 2005 Development How to get a row number which is failing during conversion RE: How to get a row number which is failing during conversion

  • Also your select statement will normally return a number of rows before it actually falls over so you could use that as a point in the DB to start looking for bad data

    e.g

    DECLARE @Tmp TABLE

    (COl1 VARCHAR(100))

    INSERT INTO @Tmp

    SELECT '1' UNION ALL

    SELECT '1111111111111111111111'

    SELECT CAST(col1 as decimal(12,7))

    FROM @Tmp

    This fails but it also return one row, so I know that it's after the first row etc...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life