-->
SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Gavin Draper's SQL Server Blog

Software Dev/DBA living the dream in sunny Brighton, UK. I've been playing with SQL Server about nearly 20 years now and still feel just as clueless as I did back then. I love writing about things I find as I go along.

Archives: July 2017

Upgrade Your SQL Server CASE Statements With IIF and CHOOSE

SQL Server 2012 introduced IIF and CHOOSE functions and I completely missed they even existed until recently. They make some quite messy CASE statements go away. Lets have a look…

Let’s imagine we have a need to display something different in our select depending on the value of a field… Read more

0 comments, 29 reads

Posted in Gavin Draper's SQL Server Blog on 6 July 2017

SQL Server 2017+ How To Replace Multiple Characters In A Single Statement With TRANSLATE

The REPLACE function in SQL Server has until now been quite limited. SQL Server 2017 has introduced a new TRANSLATE function that addresses many of these shortcomings, namely the need to daisy chain replace calls to replace multiple characters.

These two functions are however quite different in how they work… Read more

0 comments, 34 reads

Posted in Gavin Draper's SQL Server Blog on 5 July 2017