August 26, 2013 at 8:13 pm
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
August 26, 2013 at 9:02 pm
What happens when you insert multiple rows? @id = ?? @type = ??
August 26, 2013 at 9:08 pm
Hi Andrew,
Thanks for your reply ..
same behaviour for one /multiple inserts from application .
- fourthcolumn(ntext) which contains chat history and this is encrypted before it loads into table ..
trigger is unable to copy this data ..for appllication insert it shows as null.
Thanks
Suman
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy