Hi ,
trigger is working for manual inserts .. and
not working as expected for application inserts .. please help
when there is a row from application , 3 columns are copying to new table and forth column is showing as null.
alter trigger copytable
on dbo.maintable
after insert
as
begin
set nocount on
declare @id nchar(32)
declare @type nchar(10)
select @id=(id) from inserted
select @type=(type) from inserted
if (@country='A)
begin
insert into dbo.w_table1 select * from inserted
end
else if (@type='B')
begin
insert into dbo.table2 select * from maintable where id=@id
end
end