T-SQL UDF Quickly Determines How Often a Substring Appears
Microsoft SQL Server 2005 or Microsoft SQL Server 2000 database administrators sometimes come across the problem of hitting the 900-bytes limit for unique constraints. To work around the 900-byte...
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 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 ArticleUse SQL To Change A Substring
Occasionally I need to change part of a string value in a database table. SQL has three mechanisms that let me accomplish such a thing. Do you know what those three mechanisms are and how to use them?...
View ArticleCreate features for data in SQL Server using SQL and Python
This can be done by using SQL or by using a programming language like Python ... (ABS() - FLOOR(ABS()),6),1)) >= 1 then substring(PARSENAME(round(ABS() - FLOOR(ABS(
View ArticleUsing substring and ltrim in Alteryx
I have the below sql code and want to convert this to alteryx formula and apply to dataset below. isnull(SUBSTRING(rtrim(ltrim(hhm.Surname)),2,1),'2 ')...
View ArticleSubstring expressions
Informix allows you to update some parts of a CHAR and VARCHAR column by using the substring specification ( UPDATE tab SET col[1,2] ='ab'). This is not possible with other databases. Review the SQL...
View ArticleWhat's New in SQL Server 2016 (Database Engine)
SQL Server 2016 is a 64-bit application ... Parameters passed into string functions, such as into LTrim or Substring, in a native proc. Inline (meaning single statement) table-valued functions (TVFs)...
View ArticleSQL Server Functions to Mask Confidential Data using CLR or PowerShell
For the PowerShell approach, the strength is flexibility, i.e. you do not need to install anything inside SQL Server instance ... NoChange = $SourceData.Substring($StartNoChange); } else { $EndNoChange...
View ArticleSQL Server performance myth busters
The advantage of Cursors is that you can execute and delete the tables at once. In the CTE method, you need to generate the statements and after that, copy and paste the statements. The CTE code is...
View ArticleSQL SERVER – Testing Database Performance with tSQLt and SQLQueryStress
To get rid of such problems, I suggest looking into various aspects of database testing, including load testing and performance testing of SQL Server in general by ... nchar', 'ntext') THEN 2 ELSE 1...
View ArticleUsing substring and ltrim in Alteryx
I have the below sql code and want to convert this to alteryx formula and apply to dataset below. isnull(SUBSTRING(rtrim(ltrim(hhm.Surname)),2,1),'2 ')...
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 ArticleThe Team Data Science Process in action: using SQL Server
The SQL Server VM image that is optimized for datawarehousing ... FLOOR(ABS(pickup_longitude)),6),1)) >= 1 THEN SUBSTRING(PARSENAME(ROUND(ABS(pickup_longitude) -...
View ArticleWhat Agent #Job is Running – Back to Basics
I can leave the query significantly less complicated if not for the fact that I wanted to also know the sql text in a well formatted manner ... CONVERT(BINARY(16), SUBSTRING(p.program_name,...
View ArticleSQL SERVER – Testing Database Performance with tSQLt and SQLQueryStress
To get rid of such problems, I suggest looking into various aspects of database testing, including load testing and performance testing of SQL Server in general by ... nchar', 'ntext') THEN 2 ELSE 1...
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 Injection: Out-of-Band Exploitation
Recently I had a fairly slow Time-Based SQL injection vulnerability ... so I recommend combining functions like SUBSTR() and HEX() to ensure that the length does not exceed the maximum allowed in...
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 ArticleWhat Agent #Job is Running – Back to Basics
I can leave the query significantly less complicated if not for the fact that I wanted to also know the sql text in a well formatted manner ... CONVERT(BINARY(16), SUBSTRING(p.program_name,...
View Article