• John Mitchell-245523 (7/2/2015)


    ... but if I had to guess, I'd say you have numeric data stored in a varchar column. In test, all values in that column can be converted to numeric values, whereas in production, you have one or more values that can't.

    John

    I have to agree with John 10000%. This is a clear reminder of why it is so important to use proper datatypes. Storing numbers in a varchar column is asking for trouble. I cannot for the life of me understand why so many people still do this with numbers and dates. If I had a nickel for every time this has happened I could retire.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/