Simple free drive #Space alert for SQL Server databases
Here is the T-SQL for the stored procedure ... AS driveLetter ,ltrim(rtrim(substring(data, 3, len(data) - 2 - charIndex(' ', REVERSE(data), 1)))) AS FreeSpaceGB ,right(data, charIndex(' ',...
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 ArticleSQL Extract #Domain From Email
The SQL SUBSTRING Function allows you to extract and display the part of a string. In this example we will show you, How to Select string after the @ symbol in each record. In general, SQL SUBSTRING...
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 ArticleHelpDeskZ
Exploit Title: HelpDeskZ <= v1.0.2 - Authenticated SQL Injection / Unauthorized file download # Google ......
View ArticleHow to Find Queries Using an Index (and Queries Using Index Hints)
SQL Server stores query execution plans in cache ... Execution plan cache */ SELECT querystats.plan_handle, querystats.query_hash, SUBSTRING(sqltext.text, (querystats.statement_start_offset / 2) + 1,...
View ArticleParse Dynamics AX Context Info
SELECT SUBSTRING(REPLACE(LTRIM(CAST(s.context_info AS VARCHAR(256 ... This is not the spid within SQL Server. Rather this is the session id that is a different value within AX. The second piece of...
View ArticleHelpDeskZ < 1.0.2 - Authenticated SQL Injection / Unauthorized File Download
Exploit Title: HelpDeskZ <= v1.0.2 - Authenticated SQL Injection / Unauthorized file download # Google ......
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 ArticleParallel Bulk Data Import Using SQL Partition Tables
For more information about the default file locations, see File Locations for Default and Named Instances of SQL Server. DECLARE @data_path nvarchar(256); SET @data_path = (SELECT...
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 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 ArticleSQL Extract #Domain From Email
The SQL SUBSTRING Function allows you to extract and display the part of a string. In this example we will show you, How to Select string after the @ symbol in each record. In general, SQL SUBSTRING...
View ArticleParse Dynamics AX Context Info
SELECT SUBSTRING(REPLACE(LTRIM(CAST(s.context_info AS VARCHAR(256 ... This is not the spid within SQL Server. Rather this is the session id that is a different value within AX. The second piece of...
View ArticleParallel Bulk Data Import Using SQL Partition Tables
For more information about the default file locations, see File Locations for Default and Named Instances of SQL Server. DECLARE @data_path nvarchar(256); SET @data_path = (SELECT...
View ArticleLand Mines
At some point years prior, the team decided that the presence of a certain substring in the large text blob would affect the value of a very important boolean field in a non-obvious way. Excluding that...
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 ArticleSQL Server Function to Encrypt Integer Values
I coded two very short and simple T-SQL functions that do integer encryption and decryption ... WHILE @Idx < LEN(@encryptString) BEGIN SET @Letter = SUBSTRING(@ReversedEncryptString, @Idx + 1, 1)...
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 ArticleParse Dynamics AX Context Info
SELECT SUBSTRING(REPLACE(LTRIM(CAST(s.context_info AS VARCHAR(256 ... This is not the spid within SQL Server. Rather this is the session id that is a different value within AX. The second piece of...
View Article