Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
MSSQL Tutorial
String Functions 97 codes
Home
MSSQL Tutorial
String Functions
1 A SELECT statement that uses the CHAR function to format output
2 A SELECT statement that uses the LEFT function
3 A SELECT statement that uses the LEFT, RIGHT, and SUBSTRING functions
4 ASCII returns the ASCII numeric value of the leftmost character of a string
5 Changing Character Values to Lower
6 Changing Character Values to Upper
7 Changing Strings to Sentence Case
8 CHAR is the reverse of the ASCII function as it changes a numeric value in to an ASCII character
9 CHAR(13)
10 CHAR(ASCIIValue)
11 CHARINDEX returns the starting point of the first occurrence of one string within another string
12 CONVERT(varchar(20), RTRIM(au_lname) + , + RTRIM(au_fname)
13 Converting a Character Value to ASCII and Back to Character
14 Converting an ASCII Value to Character
15 Determining the Number of Characters or Bytes in a String by using LEN
16 Determining the Similarity of Strings
17 DIFFERENCE function returns a value between 0 and 4 that reflects how close a match there is between the two strings
18 DIFFERENCE() is a wrapper around two SOUNDEX()
19 DIFFERENCE(Nite, Knight)
20 Finding the Start Position of a String Within Another String
21 Finding the Start Position of a String Within Another String Using Wildcards
22 FORMATMESSAGE function
23 Get Character Unicode Values
24 Get index of the delimiting space
25 Get the last name
26 How to use the string functions to parse a string
27 LEFT function returns a number of characters from the left-hand side of a string
28 LEFT(CompanyName, 1) and like
29 LEN Returns the length of a string as an integer
30 LOWER Translates all characters within the string to lower case
31 LTRIM Removes leading spaces from a string
32 NCHAR Returns a Unicode character representing the number passed as a parameter
33 Outputting an Expression in Reverse Order
34 Padding a number for business purposes with right
35 PATINDEX searches for a pattern of characters within a string
36 Prefixing a Numeric Value with Zeros
37 QUOTENAME function
38 QUOTENAME takes a character string and turns it in to a valid SQL Server identifier, which can be used as a name for a SQ
39 Removing Leading Blanks
40 Removing Trailing Blanks
41 Repeating a Blank Space N Times
42 Repeating an Expression N Number of Times
43 REPLACE takes three strings as parameters, and all instances of the second string in the first are replaced by the third
44 REPLICATE is used if you wish to replicate the same string several times
45 REPLICATE(A, 3)
46 Return first name
47 Returning a Chunk of an Expression
48 Returning Integer Unicode Values
49 REVERSE takes the string input, and reverses the order of the information
50 RIGHT return a number of characters from the right-hand side of a string
51 RTRIM a column
52 RTRIM will remove trailing spaces from a string
53 Select CHARINDEX(-, (559) 555-1212)
54 SELECT CHARINDEX(Mars, The stars near Mars are far from ours)
55 Select CHARINDEX(SQL, SQL Server)
56 SELECT DIFFERENCE (Redmond, Renton)
57 Select LEFT(SQL Server, 3)
58 Select LEN( SQL Server ) (space at both ends)
59 Select LEN(SQL Server)
60 Select LOWER(SQL Server)
61 Select LTRIM( SQL Server )
62 Select LTRIM(RTRIM( SQL Server ))
63 SELECT PATINDEX(%M_rs%, The stars near Mars are far from ours)
64 Select PATINDEX(%v_r%, SQL Server)
65 Select REPLACE(RIGHT((559) 555-1212, 13), ) , -)
66 Select RTRIM( SQL Server )
67 SELECT STR(1, 12, 4)
68 SELECT STR(1, 6, 4)
69 SELECT STR(123 456789, 8, 4)
70 Select SUBSTRING((559) 555-1212, 7, 8)
71 Select UPPER(ca)
72 Sound difference
73 SOUNDEX checks how similarly sounding two tested strings can be
74 SOUNDEX(Knight)
75 SPACE returns a set number of spaces
76 STR takes a numeric value and changes the data type to a char
77 STR() converts a numeric value to a string
78 STR(float_expression, character_length, number_of_decimal_places)
79 STUFF(notes, PATINDEX(%computer[^s]%, notes)
80 Stuffing a String into a String
81 SUBSTRING is used to retrieve part of a string from another string The syntax for the function is as follows
82 SUBSTRING(FullName, CHARINDEX( , FullName) + 1, LEN(FullName))
83 Substring with variable
84 Taking the Leftmost or Rightmost Part of a String
85 Taking the Rightmost Part of a String
86 The LOWER() and UPPER() Functions
87 The LTRIM() and RTRIM() Functions
88 The NCHAR() function takes a positive integer between 0 and 65,535 and returns a datatype of nchar(1) with the correspond
89 The REPLICATE() and LEN() Functions
90 The syntax for STUFF is STUFF(string_used_as_basis, start_point, length, string_to_insert)
91 UNICODE Returns the integer Unicode value of a single leftmost character in a string
92 UPPER Translates all characters within the string to upper case
93 Use DIFFERENCE in where clause
94 Use LEFT and RIGHT to get sub value from a column
95 Use SOUNDEX(au_lname) and DIFFERENCE
96 Using String Functions to Search for Phonetically Similar Data
97 WHERE PATINDEX(%computer[^s]%, notes) 0