Datatype conversion functions  Converting from one character type to another

Chapter 2: Transact-SQL Functions

Converting character data to a noncharacter type

You can convert character data to a noncharacter type—such as a money, date/time, exact numeric, or approximate numeric type—if it consists entirely of characters that are valid for the new type. Leading blanks are ignored. However, if a char expression that consists of a blank or blanks is converted to a datetime expression, Adaptive Server converts the blanks into the default datetime value of “Jan 1, 1900.”

Syntax errors are generated when the data includes unacceptable characters. Following are some examples of characters that cause syntax errors:

Implicit conversions between unichar/univarchar and datetime/smalldatetime are supported.





Copyright © 2005. Sybase Inc. All rights reserved. Converting from one character type to another

View this book as PDF