Categories
SQL

Indexing Computed Columns

In the previous introduction post we covered how to add a computed column to a table and that by default this becomes part of the table metadata when its created. Here we’re going to look at benefits we can get with the performance of these columns when applying an index to them. We’ll use the […]

Categories
SQL

Altering Computed Columns

In a previous post we covered some of the fundamentals about computed columns and we saw the benefits which they can bring for us. Once we’ve implemented them, one of the challenges we may have is if we need to make adjustments to their expression or the fields they reference. Lets start off with a […]

Categories
T-SQL Tuesday

T-SQL Tuesday #146: Upending Preconceived Notions

This month’s invitation comes from Andy Yun who asked us to share something we’ve learned and which has subsequently changed our opinions. There were two immediate examples which came to mind, the first on a more technical note and the second somewhat more personal: “Table Variables Are Fast” Many years ago I’d found myself with […]

Categories
SQL

Introduction to Computed Columns

Using a computed column in a table allows you to have a calculation pre-baked into your schema. They also allow you to choose if you’d like that calculated value to be physically stored within the table (persisted) or to be calculated each time you query the table. To demonstrate this we’ll use a small sales […]