Showing posts with label string function in sql server. Show all posts
Showing posts with label string function in sql server. Show all posts

Tuesday, 19 March 2013

Use of String function in Sql Server


Use of String Function in SQL Server
SQL Server support string function which is Already defined. Following are some important string function and their uses:-
       1.       Char (ASCII code)
This function returns the The character which is equivalent to particular ASCII code which you will pass too This function.
For Example:-
Select char (66);
This function will Return B.
      2.       ASCII (Char)
This function Returns the ASCII code which is equivalent to particular char which you will Pass to this function.
For example:-
Select ASCII ('B');
this function will return 66
     3.       Len(char)
This function returns the length of string which you will pass to len function. It returns integer value.
For Example:-
select LEN('isha malhotra');
this function will return 13
  4.  Left(char, number of char)
This function will returns the number of char from left.
For example:-
select LEFT('isha malhotra',3);
this function will return ish.