July 21, 2017 at 7:54 am
Hi,
How to add a computed expression in an existing table column.
Regards
Binu
July 21, 2017 at 9:01 am
binutb - Friday, July 21, 2017 7:54 AMHi,
How to add a computed expression in an existing table column.Regards
Binu
You'll need to add a new column. AFAIK, you cannot modify an existing physical column to a computed column.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
July 21, 2017 at 9:38 am
Phil Parkin - Friday, July 21, 2017 9:00 AMbinutb - Friday, July 21, 2017 7:54 AMHi,
How to add a computed expression in an existing table column.Regards
BinuYou'll need to add a new column. AFAIK, you cannot modify an existing physical column to a computed column.
Also note that, new column means new name and new values. You can't rename a computed column nor can you explicitly add values (e.g. INSERT <table>(<computed column>) VALUES ('123');).
If the computed value is the same as the what's already in there then you could drop the column and recreate it as a computed column. If not then what you are asking is impossible as far as I know.
-- Itzik Ben-Gan 2001
July 21, 2017 at 11:14 am
binutb - Friday, July 21, 2017 7:54 AMHi,
How to add a computed expression in an existing table column.Regards
Binu
Normally you'll do that via a trigger, but you do need to elaborate further as the question is quite vague.
😎
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply