String 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 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 ArticleT-SQL Substring: Splicing a String from Another String
Transact-SQL or T-SQL is a way to run SQL statements on your database tables. SQL Server offers several string functions, which you should know to properly manipulate and work with your data. The...
View ArticleHey, those variables don't grow on trees, y'know!
And it's almost exactly what fish described in the meeting: He uses a substring function to extract the date and time from the filename and store them into two variables, then concatenates the two...
View ArticleScript to find out when SQL Server #Restore will finish
Did you know that SQL Server’s ERRORLOG actually calculates its own estimates ... sp_readerrorlog 0, 1, 'Recovery completed', @DBName SELECT TOP 1 @DBName AS [DBName] ,[LogDate] ,CASE WHEN...
View ArticleStairway to U-SQL Level 15: U-SQL Global Scalar Functions With C#
postcode : postcode.Substring(0, postcode.IndexOf ... Navigate to Data Lake Analytics -> U-SQL Databases -> UkPostcodes -> Assemblies. You should see the PostcodeLibrary assembly under...
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 ArticleQuery plan returns NULL when using SQL Server DMV sys.dm_exec_query_plan
Below, I have an alternative script to get the cached plan. SELECT (SELECT TOP 1 SUBSTRING(sql_text.text,statement_start_offset / 2+1 , ((CASE WHEN statement_end_offset = -1 THEN...
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 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 ArticleStairway to U-SQL Level 15: U-SQL Global Scalar Functions With C#
postcode : postcode.Substring(0, postcode.IndexOf ... Navigate to Data Lake Analytics -> U-SQL Databases -> UkPostcodes -> Assemblies. You should see the PostcodeLibrary assembly under...
View ArticleT-SQL Substring: Splicing a String from Another String
Transact-SQL or T-SQL is a way to run SQL statements on your database tables. SQL Server offers several string functions, which you should know to properly manipulate and work with your data. The...
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 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 ArticleSubstring for data in dataset and sql table
With the guides and helps from fellow members here, i now can have data from dictionary in dataset by using this code: data want; set sashelp.vcolumn (where=(libname="CDSSTG")); run; However, i want to...
View ArticleStairway to U-SQL Level 15: U-SQL Global Scalar Functions With C#
postcode : postcode.Substring(0, postcode.IndexOf ... Navigate to Data Lake Analytics -> U-SQL Databases -> UkPostcodes -> Assemblies. You should see the PostcodeLibrary assembly under...
View ArticleQuery plan returns NULL when using SQL Server DMV sys.dm_exec_query_plan
Below, I have an alternative script to get the cached plan. SELECT (SELECT TOP 1 SUBSTRING(sql_text.text,statement_start_offset / 2+1 , ((CASE WHEN statement_end_offset = -1 THEN...
View ArticleSQL Azure Reporting Automation
Unlike normal SQL Server where a batch script automation can be done using ... of the individual databases [double]$TotalSizeByte = [double]$TotalSizeByte + $db.Substring($db.LastIndexOf(",")+1)
View Article