Changing Computed Columns

Steve Jones shows a how to modify a computed column:

I was working with a computed column the other day, and realized I had the wrong definition. In this case, I was performing some large calculation, and the result was larger than an int. However the first part of the formula was an int, which resulted in an implicit conversion to an int.

I needed to change the formula, and then realized that plenty of people might not work with computed columns much, and not realize how you alter a computed column.

You don’t.

In fact, you need to drop the column and add it back. In my case, this was what I did.

Fortunately, this tends to be a pretty quick operation, especially if the computed column is non-persisted.

Related Posts

AVG And Data Types

Kendra Little explains how the AVG() function works with a couple different data types: This week’s Quizletter featured a quiz on using the AVG() function in SQL Server. I was inspired to write this quiz because I’ve been teaching TSQL School each week. When we covered aggregate functions, I remembered just how tricksy and non-average that AVG() can be. Want […]

Read More

Data Types In R

Ellen Talbot gives us an overview of the different data types in R: Now here’s something we didn’t cover in the video and is especially helpful if something just WILL NOT work and you’ve spent all morning panic eating biscuits. You can write checks to see if something is numeric, or an integer, with is.numeric() or is.integer(). The […]

Read More


May 2016
« Apr Jun »