Categories
SQL

Comparing TRY Functions for Numeric Conversion

In the previous post we looked at how ISNUMERIC and TRY_CAST work and why we may want to utilise the latter when building validation for our data. When SQL Server 2012 rolled around it wasn’t only TRY_CAST which was added, we also had TRY_CONVERT and TRY_PARSE introduced too. Here we’re going to look at how […]

Categories
SQL

Numeric Data Validation

Data validation is key when ingesting from external sources. As we can’t always be certain of data quality we inevitably find bad data which needs to be handled. Here I wanted to look at a couple of options for validating numeric data. Here’s the scenario – we’ve got data which may have been received via […]

Categories
T-SQL Tuesday

T-SQL Tuesday #169 – Giving Thanks

This month’s invitation from Kay asks us to look back through the year and consider those who we are thankful for. Whilst I should be thanking those close to me for their ongoing support through a lot this year – the fact of it is that they aren’t the type of folks to be reading a blog about SQL […]

Categories
SQL

Optimising Sort Operators in Window Functions

We’re on quite a roll with window functions these past few weeks. Last week we looked at the operators we’d see in execution plans when using a window function. This week I wanted to tackle one of the more troublesome ones specifically: the Sort operator. We know that sort operators are expensive in our queries. To use […]