17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix A: System Functions<br />

ASCII<br />

❑ UNICODE<br />

❑ UPPER<br />

The ASCII function returns the ASCII code value of the leftmost character in character_expression.<br />

The syntax is as follows:<br />

CHAR<br />

ASCII()<br />

The CHAR function converts an ASCII code (specified in expression) into a string. The syntax is as follows:<br />

CHAR()<br />

The expression can be any integer between 0 and 255.<br />

CHARINDEX<br />

The CHARINDEX function returns the starting position of an expression in a character_string. The<br />

syntax is as follows:<br />

CHARINDEX(, [, ])<br />

The expression parameter is the string, which is to be found. The character_string is the string to<br />

be searched, usually a column. The start_location is the character position to begin the search, if this<br />

is anything other than a positive number, the search will begin at the start of character_string.<br />

DIFFERENCE<br />

The DIFFERENCE function returns the difference between the SOUNDEX values of two expressions as an<br />

integer. The syntax is as follows:<br />

DIFFERENCE(, )<br />

This function returns an integer value between 0 and 4. If the two expressions sound identical (for example,<br />

blue and blew) a value of 4 will be returned. If there is no similarity, a value of 0 is returned.<br />

LEFT<br />

634<br />

The LEFT function returns the leftmost part of an expression, starting a specified number of characters<br />

from the left. The syntax is as follows:<br />

LEFT(, )<br />

The expression parameter contains the character data from which the leftmost section will be extracted. The<br />

integer parameter specifies the number of characters from the left to begin — it must be a positive integer.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!