SDU Tools v24 is now available for download

SDU Tools v24 is now available for download

Just a heads-up that v24 of SDU Tools went out to SDU Insiders last week. If you haven’t used SDU Tools, they are just a large library of functions implemented in T-SQL. You can use them as a full library or use them as examples of code in work you are trying to do.

Backwards Compatibility

We’ve also tried to keep all the code working for all versions of SQL Server that we see clients using. That means from SQL Server 2008 to SQL Server 2022. We also have an Azure SQL DB version.

At times, that has been quite a challenge, mostly with keeping it working on older versions.

From v24, we’ve stopped doing any testing on SQL Server 2008. We’ll test from SQL Server 2012 forwards. That will also give us the opportunity over time, to improve the code base where we can take advantage of many of the improvements added in 2012.

Self-describing library

One recent request (from Lee Beer) that sounded very interesting was to make the toolset self-describing. (Thanks Lee !)

We’ve now done that. You can query the Tools view to check out all the installed SDU Tools.

Enhancements in this version

You can find details about SDU Tools here: https://sdutools.sqldownunder.com

In v24, we’ve added or enhanced the following (new YouTube links included)

  • FormatAustralianPhoneNumber - takes a string that contains digits, extracts the digits, and formats the remaining number according to Australian phone number standards. Note: if the phone number starts with an international prefix + then the phone number is returned unchanged. The function could easily be adapted for other phone number formatting requiremments.
  • FilePathComponents - takes a full file path, and extracts the folder path, the file name, and the file extension.
  • Processing URLs with URLComponents, URLToProtocol, URLToHostName, URLToPathName, URLToSearchTerms, URLToAnchor - this set of functions take URLs and return either all components, or individual components of protocol, host name, path name, search terms, and anchor.
  • DateDiffNoSundays - calculate the number of days between two dates in T-SQL, where you don’t want to count Sundays.
  • ListUserDefinedDataTypes - returns a list of all user-defined (alias) data types within a database. It also shows their underlying system data type.
  • ListViewColumnsAndDataTypes - returns a list of all columns defined within views, and their underlying data types.
  • ResetSequence - resets the value of a sequence, either back to a default starting value of 1, or to a specific next value.
  • ListInstalledSQLServerInstances - finds all the instances of SQL Server, their type (eg. SSIS or SSRS or SSAS), and their version, that are installed on a server. This tool requires administrative permission and is obviously for SQL Server only. (No Azure SQL DB option)

Two fixes in this version

We’ve also fixed a few things in this version, based upon feedback from users.

Case sensitivity is always a pain in the neck. Wilfred van Dijk found a further case sensitivity issue with the popular StripDiacritics function. That’s been fixed now. (Thanks Wilfred!)

ExtractSQLTemplate now handles incoming SQL scripts that use sp_cursoropen better.

A few enhancements in this version

AnalyzePerformanceTuningTrace now shows AvgReadGB in each section and write percentage.

XMLDecodeString now handles ASCII code decoding. (Thanks to Shaun Baggett for this one)

I hope you find the updates useful.

2024-09-10