November 16th, 2010
admin
You can use the string functions to manipulate the string values in the result set. String functions are used with both char and nchar data types. The list below contains the set of string functions available in SQL Server 2005.
Read more…
Categories: Functions, Functions and DMVs, SQL Queries, SQL Server, String Functions, T-SQL, T-SQL, T-SQL Tags: functions, SQL Server, string, string functions, T-SQL, Transact SQL
Although these functions are not commonly used, these are really powerful in searching a pattern and returning the location of text/ string/ pattern. By understanding the functionality of both the string functions, we will be able to understand the difference as well.
PATINDEX()
The function searches for a pattern in a string / expression and returns the starting position of the first occurrence of the pattern. It works similar to the LIKE operator in any query.
Read more…
Categories: Functions and DMVs, SQL Queries, SQL Server, String Functions, T-SQL, T-SQL, T-SQL, Tips & Tricks Tags: charindex, functions, patindex, query, SQL Server, string functions, Transact SQL