Converting from one character type to another  Rounding during conversion to or from money types

Chapter 15: Using the Built-In Functions in Queries

Converting numbers to a character type

You can convert exact and approximate numeric data to a character type. If the new type is too short to accommodate the entire string, an insufficient space error is generated. For example, the following conversion attempts to store a five-character string in a one-character type:

select convert(char(1), 12.34)

It fails because the char datatype is limited to one character, and the numeric 12.34 requires five characters for the conversion to be successful.





Copyright © 2005. Sybase Inc. All rights reserved. Rounding during conversion to or from money types

View this book as PDF