sql server - How to change a normal column to "computed" column -


i have table in mssql server 2008. change 1 of column in table computed column. tell me how do ?

preserve the old data:

exec sp_rename 'mytable.oldcol', 'renamedoldcol', 'column'; 

add computed column

alter table mytable add computedcol (some expression); 

then, when you're happy

alter table mytable drop column renamedoldcol; 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -