I hope some of this makes some sense to you?
I have a number of tables, all with the same problem.
one of my columns is a concatenation of 3 other columns, how can I create a trigger that will update this column automatically when the records have been created?
The columns in question are:
type_id, varchar(2)
urn, int
year_id, char(4)
set_id, char(10)
set_id is a concatenation of the other 3, this code works fine if ran on its own:
update set_records set set_id=type_id + '/' + (cast(urn as varchar(10))) + '/' + year_id
This brings back the values as I want them i.e. RR/1/2005
How can I create this as a update trigger in the table set_records??
I have a number of tables, all with the same problem.
one of my columns is a concatenation of 3 other columns, how can I create a trigger that will update this column automatically when the records have been created?
The columns in question are:
type_id, varchar(2)
urn, int
year_id, char(4)
set_id, char(10)
set_id is a concatenation of the other 3, this code works fine if ran on its own:
update set_records set set_id=type_id + '/' + (cast(urn as varchar(10))) + '/' + year_id
This brings back the values as I want them i.e. RR/1/2005
How can I create this as a update trigger in the table set_records??