224 Part I EXAM PREPARATION Character Functions SQL

224 Part I EXAM PREPARATION Character Functions SQL Server also provides a full array of character (string) functions. Character functions enable you to easily manipulate attributes that are character-specific. Most of the functions provided in table are normally used and therefore you should regularly practice using them. For example, if you want to not include the blank spaces before a value or after a value, you could use the LTRIM and RTRIM functions. Table 4.9 is a compilation of the various character functions included in SQL Server s version of SQL. TABLE 4.9 CHARACTER FUNCTIONS IN T-SQL Function Parameters Result + Expression1 + Concatenates a string; brings two strings expression2 together. ASCII String expression Gets the ASCII code value of the string. CHAR Integer expression Changes the ASCII integer into a character. LEN String expression Identifies the length of an expression in characters. LOWER String expression Converts uppercase to lowercase. LTRIM String expression Removes leading blanks. PATINDEX Pattern, expression Returns the position of the beginning of the occurrence of the pattern. If the pattern is not found, it returns a zero. REPLICATE String expression, Repeats a character expression the integer expression number of times specified. REVERSE String expression Returns the reverse of a string expression. RTRIM String expression Removes trailing blanks. SPACE Integer expression Returns a string of repeated spaces. STUFF String expression1, Deletes a specified length of characters start, length, String and inserts another set of characters at expression2 a specified starting point. SUBSTRING String expression, Returns part of a string expression. start, length UPPER String expression Makes all lowercase letters uppercase.

For reliable and cheap web hosting services please check tomcat web hosting website.

Comments are closed.