CREATE TRIGGER [Trig_CheckReleased] ON dbo.t_candidate1
FOR INSERT, UPDATE
AS
My name is Claude Johnson and I have attached a new trigger I've created below and what I am trying to do within this trigger is call a value through a SELECT statement and then if a particular condition is TRUE, I would set or 'turn on' a field based on this result.
So my question is, how can I (based on my synatx below), set the field 'release' to a status of ON ?? The default value of the field 'release' in my table, t_candidate1 is '0'.
Can this be done and if so, what is the basic syntax to do so?
Thank you in advance,
Claude
------------
Declare @release smallint,
@old_release smallint
select @release = release from INSERTED
select @old_release = release from t_candidate1
if @old_release = 0
begin
if @release = 1
begin
??set release field to ON if this condition is TRUE
end
end
FOR INSERT, UPDATE
AS
My name is Claude Johnson and I have attached a new trigger I've created below and what I am trying to do within this trigger is call a value through a SELECT statement and then if a particular condition is TRUE, I would set or 'turn on' a field based on this result.
So my question is, how can I (based on my synatx below), set the field 'release' to a status of ON ?? The default value of the field 'release' in my table, t_candidate1 is '0'.
Can this be done and if so, what is the basic syntax to do so?
Thank you in advance,
Claude
------------
Declare @release smallint,
@old_release smallint
select @release = release from INSERTED
select @old_release = release from t_candidate1
if @old_release = 0
begin
if @release = 1
begin
??set release field to ON if this condition is TRUE
end
end