The variables @queue_name and @app_id are null in the following trigger. However, the app_id and queue_activity_id fields within the t_ccs_queue table are not null - seems like the inseretd table is not storing the values. Any suggestions?
CREATE trigger ats_file_retrieve on dbo.t_ccs_queue for insert as
begin
declare @queue_name varchar(50)
declare @app_id int
select @queue_name = act.activity_desc, @app_id = inserted.app_id
from dbo.t_ccs_admin_activities as act, inserted
where act.activity_id = inserted.queue_activity_id
end
CREATE trigger ats_file_retrieve on dbo.t_ccs_queue for insert as
begin
declare @queue_name varchar(50)
declare @app_id int
select @queue_name = act.activity_desc, @app_id = inserted.app_id
from dbo.t_ccs_admin_activities as act, inserted
where act.activity_id = inserted.queue_activity_id
end