SUBSTR functions
The SUBSTR functions (SUBSTR, SUBSTRB, SUBSTRC, SUBSTR2, and SUBSTR4) return a portion of string, beginning at a specified position in the string. The functions vary in how they calculate the length of...
View Articlesubstring Function
Returns the substring of the first argument starting at the position specified in the second argument and the length specified in the third argument. Each character in the string is considered to have...
View ArticleT-SQL 101: Built-In Functions
T-SQL has many built-in functions that come in four basic flavors ... Commonly used string-manipulation functions include LEFT, RIGHT, SUBSTRING, and REPLACE. LEFT and RIGHT. The LEFT and RIGHT...
View ArticleString Comparisons in SQL: The Longest Common Substring.
I’ve always wanted a SQL function that tells me the longest substring shared between two strings. As a present to myself, I’ve written one. I hope someone else finds it useful. There are several...
View ArticleOptimizing Substring Search Performance in SQL Server
The requirement of searching data by part of the value is very common in business applications. All of us are familiar with it – users want to be able to search by entering just a few letters from the...
View ArticleSQL SUBSTRING Function
The SQL SUBSTRING function is one of the SQL String Function, which is used to return specified number of characters from the given expression. The SUBSTRING function uses its third argument to decide,...
View ArticleSearching substrings in MDX
Most of you would be familiar with substring searches in SQL. Today, we will see how to replicate the same scenario in MDX. 1) Suppose we have to find all the employee names having ‘David’ as a...
View ArticleChange a Substring with SQL
However, my SQL command gives me an invalid token error at the opening parenthesis of SUBSTR in the SET statement. Is there a rule that you can’t use SUBSTR in a SET statement? If so, do you have a...
View ArticleString Comparisons in SQL: The Longest Common Substring.
I’ve always wanted a SQL function that tells me the longest substring shared between two strings. As a present to myself, I’ve written one. I hope someone else finds it useful. There are several...
View ArticleSQL SUBSTRING Function
The SQL SUBSTRING function is one of the SQL String Function, which is used to return specified number of characters from the given expression. The SUBSTRING function uses its third argument to decide,...
View ArticleChange a Substring with SQL
However, my SQL command gives me an invalid token error at the opening parenthesis of SUBSTR in the SET statement. Is there a rule that you can’t use SUBSTR in a SET statement? If so, do you have a...
View ArticleSQL Server Substring with CharIndex
In this article we are going to explore the T-SQL function CharIndex and also how to use it with another T-SQL function Substring(). CharIndex: This function returns the location of a substring in a...
View ArticleSUBSTRING (Transact-SQL)
Returns part of a character, binary, text, or image expression in SQL Server. The following example shows how to return only a part of a character string. From the sys.databases table, this query...
View ArticleHow Long Before Your Database Runs Out of #Space?
With dozens of live SQL instances and many terabytes of data ... getdate())) as TimeCollected ,rtrim(ltrim(SUBSTRING(line,1,CHARINDEX('|',line) -1))) as drivename...
View ArticleSQL Server 2016 STRING_SPLIT Function
During your experience as a SQL Server Database Administrator ... FROM Split WHERE endpos > 0 ) SELECT 'Id' = ROW_NUMBER() OVER (ORDER BY (SELECT 1)), 'Value' =...
View ArticleString Comparisons in SQL: The Longest Common Substring.
I’ve always wanted a SQL function that tells me the longest substring shared between two strings. As a present to myself, I’ve written one. I hope someone else finds it useful. There are several...
View ArticleSQL SUBSTRING Function
The SQL SUBSTRING function is one of the SQL String Function, which is used to return specified number of characters from the given expression. The SUBSTRING function uses its third argument to decide,...
View ArticleT-SQL 101: Built-In Functions
T-SQL has many built-in functions that come in four basic flavors ... Commonly used string-manipulation functions include LEFT, RIGHT, SUBSTRING, and REPLACE. LEFT and RIGHT. The LEFT and RIGHT...
View ArticleString Comparisons in SQL: The Longest Common Substring.
I’ve always wanted a SQL function that tells me the longest substring shared between two strings. As a present to myself, I’ve written one. I hope someone else finds it useful. There are several...
View ArticleT-SQL 101: Built-In Functions
T-SQL has many built-in functions that come in four basic flavors ... Commonly used string-manipulation functions include LEFT, RIGHT, SUBSTRING, and REPLACE. LEFT and RIGHT. The LEFT and RIGHT...
View Article