Blog

Why Use QUOTENAME?

QUOTENAME can be used to make sure database objects are valid in your query. Most of the time, objects like table names only contain valid characters, so there’s nothing to worry about. But nobody’s perfect. Let’s look at an example of what can happen when somebody creates a table with a forward slash in the…

What is the SQL Server CLR Integration?

I was setting up a dev environment for a new application recently. All seemed to be well until I went to actually run the application. I was getting a vague error in the application and still didn’t know the exact cause. I fired up an XEvents session to find the query causing the issue and…

What Does the NTILE Function Do?

Have you ever used the NTILE function? Or have you even heard of the NTILE function? It seems to be one of the lesser known, lesser used window functions in SQL Server. I’ve never come across it in the wild but maybe there are those that use it all the time. Either way, let’s have…

T-SQL Tuesday #162 – Data Science and ChatGPT

This month’s invitation comes from Tomaz Kastrun who asks us how we’ve embraced ChatGPT. Click the T-SQL Tuesday logo to the right to read the full invitation post and read on below for some of my thoughts on ChatGPT so far. Calculating One way I’ve used ChatGPT is as a calculator of sorts. That may…

What are Sparse Columns?

Have you ever maxed out the SQL Server table column limit yet still needed more columns? Hopefully not considering SQL Server has a max limit of 1024 columns per table. But as I found out, it’s possible for someone to reach out and ask for even more. Sparse columns are an option to consider when…

Updating an Always Encrypted Column

When recently troubleshooting an issue, I needed to update a database record to test application functionality. Because the table had an Always Encrypted column, some extra steps were needed to make the UPDATE successfully. Let’s look at the error encountered and how it was resolved. What is Always Encrypted? Always Encrypted was made available to…

Upgrading After Evaluation Edition Expires

SQL Server Evaluation editions are great to use for testing early releases. When the real deal comes out, it’s best to upgrade then and there (probably Evaluation to Developer if you’re testing and experimenting). But what happens if you let an evaluation edition expire by accident? The good news is you can still upgrade but…

T-SQL Tuesday 161 – Having Fun

This month’s T-SQL Tuesday topic comes from Reitse Eskens who asks us to share some fun we’re having with our code. I’ve had my share of side projects that have kept me busy. One stuck out in my mind which I’ll discuss below. To read the full T-SQL Tuesday invitation for this month, click the…

Ranking in SQL Server

Have you ever needed a Top 10 list? It may sound like a simple task but not all lists are the same. Consider records where there are ties. Does that mean you need more than 10 records? If two records tie for first does that mean the third record is considered to be ranked second?…

Boost Your PowerShell Confidence with WhatIf

We’ve all had moments of instant regret. Maybe it was missing that WHERE clause when executing a SQL statement or seeing something like “500 rows affected” when expecting only 1. These are sinking feelings we never want to experience again. To avoid that pain, SQL Server has BEGIN/ROLLBACK/COMMIT that you can use to help check…

Loading…

Something went wrong. Please refresh the page and/or try again.


Follow My Blog

Get new content delivered directly to your inbox.