When I try to run this I get an error saying Incorrect syntax near '@as_xml'and it fails on this line
"Select @as_oper = 'INSERT' " specifically. The snippent of the trigger is below. Any help is appreciated
Thanks
JD
CREATE TRIGGER asst_trig ON fa
FOR INSERT
AS
Declare @as_xml varchar(255),@as_code varchar(20),@as_tag varchar(20),@as_loc varchar(20),@as_tab_name varchar(50),@as_oper varchar(20)
Select @as_code = Inserted.asset_code,
@as_tag = Inserted.asset_tag,
@as_loc = Inserted.asset_location from Inserted
Select @as_tab_name = 'FA'
Select @as_oper = 'INSERT'
Select @as_xml = '<asset_tag>'+@as_tag+'</asset_tag>'
Select @as_xml = @as_xml + '<asset_code>'+@as_code+'</asset_code>'
Select @as_xml = @as_xml + '<asset_location>'+@as_loc+'</asset_location>'
/* Generate a row in trans */
exec sp_insert_pv_trans (@as_xml,@as_tab_name,@as_oper)
"Select @as_oper = 'INSERT' " specifically. The snippent of the trigger is below. Any help is appreciated
Thanks
JD
CREATE TRIGGER asst_trig ON fa
FOR INSERT
AS
Declare @as_xml varchar(255),@as_code varchar(20),@as_tag varchar(20),@as_loc varchar(20),@as_tab_name varchar(50),@as_oper varchar(20)
Select @as_code = Inserted.asset_code,
@as_tag = Inserted.asset_tag,
@as_loc = Inserted.asset_location from Inserted
Select @as_tab_name = 'FA'
Select @as_oper = 'INSERT'
Select @as_xml = '<asset_tag>'+@as_tag+'</asset_tag>'
Select @as_xml = @as_xml + '<asset_code>'+@as_code+'</asset_code>'
Select @as_xml = @as_xml + '<asset_location>'+@as_loc+'</asset_location>'
/* Generate a row in trans */
exec sp_insert_pv_trans (@as_xml,@as_tab_name,@as_oper)