<p>Does anyone know of a way to alter a computed column without dropping the column in SQL Server. I want to stop using the column as a computed column and start storing data directly in the column, but would like to retain the current values.</p>

<p>Is this even possible?</p>

[{'answer_id': 44128, 'author': 'Craig', 'author_id': 2894, 'author_profile': 'https://Stackoverflow.com/users/2894', 'pm_score': 1, 'selected': False, 'text': "<p>Ok, so let me see if I got this straight.  You want to take a column that is currently computed and make it a plain-jane data column.  Normally this would drop the column but you want to keep the data in the column.</p>\n\n<ol>\n<li>Make a new table with the primary key columns from your source table and the generated column.</li>\n<li>Copy the data from your source table into the new table.</li>\n<li>Change the column on your source table.</li>\n<li>Copy the data back.</li>\n</ol>\n\n<p>No matter what you do I am pretty sure changing the column will drop it.  This way is a bit more complex but not that bad and it saves your data.</p>\n\n<p>[Edit: @SqlMenace's answer is much easier. :)  Curse you Menace!! :)]</p>\n"}, {'answer_id': 44129, 'author': 'SQLMenace', 'author_id': 740, 'author_profile': 'https://Stackoverflow.com/users/740', 'pm_score': 4, 'selected': True, 'text': '<p>Not that I know of but here is something you can do</p>\n\n<p>add another column to the table\nupdate that column with the values of the computed column then drop the computed column</p>\n'}, {'answer_id': 44175, 'author': 'harpo', 'author_id': 4525, 'author_profile': 'https://Stackoverflow.com/users/4525', 'pm_score': 2, 'selected': False, 'text': "<p>If you need to maintain the name of the column (so as not to break client code), you will need to drop the column and add back a stored column with the same name.  You can do this without downtime by making the changes (along the lines of SQLMenace's solution) in a single transaction.  Here's some pseudo-code:</p>\n\n<pre>\nbegin transaction\n   drop computed colum X\n   add stored column X\n   populate column using the old formula\ncommit transaction\n</pre>\n"}]
['https://Stackoverflow.com/questions/44118', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3821/']