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

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -