• CELKO (10/28/2016)


    You do not understand the difference between a string and a numeric in SQL. Registration numbers are called "tag numbers" in data modeling; they are a name of an entity that happens be written with digits and perhaps other punctuation rather than alphabetic characters.

    You have tried to convert the string of digits into a numeric. The SQL engine has picked the simplest representation of a numeric value that it could find. In this case it happens to be scientific or exponential notation.

    If you would followed forum rules and posted DDL, we would have seen this immediately and I had to guess. This mistake is most commonly made by old COBOL programmers, because COBOL represents everything in character strings.

    Actually this mostly commonly caused by loading a spreadsheet into SQL Server, the spreadsheet engine forcing exponential format to be used.

    COBOL, COBOL, COBOL, you really should get yourself out of the '80s, it's time to move on!

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.