triggers - SQL - Default Value of other columns/fields -
i have access db contains following column/fields: [id], [itemcode], [imagecode].
the filecode "computed" expression of:
[itemcode] & "img" & [id] & ".jpg"
so if [id] , [itemcode] "4" , "item008a" (respectively) [imagecode] be: "item008aimg4.jpg".
however, migrating sql, , while rebuilding table, found can't column's default value or computed formula.
i've read triggers best resolve, have written triggers affect other tables , not (if possible?).
is there more direct? if not, trigger like?
any appreciated. thanks.
you can add computed column
alter table tablea add imagecode cast(itemcode varchar(10)) + 'img' + cast( id varchar(10)) + '.jpg'
Comments
Post a Comment