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
Post a Comment