Thursday 4 October 2007

ASCII AND CHAR!

ASCII

The ASCII function can be used to return the character code of a specific ASCII character. The following Transact SQL statement returns the ASCII character code for the letter 'a', which is 97:

select ascii('a') as CharacterCode

Note that if a string of more than one characters is supplied as the ASCII function's argument, only the corresponding character code of the first character is returned.
CHAR

The CHAR function can be used to return the character corresponding to a specific ASCII code. The following Transact SQL statement returns the ASCII character corresponding to the code of 120, which is 'x':

select char(120) as ASCIICharacter

Thursday 30 August 2007

BCP command

http://www.simple-talk.com/content/print.aspx?article=307