unable to update table DB_Main" attachment added
Posted: Thu Feb 23, 2017 7:13 pm
I'm trying to implement a very simple trigger in DB_Main table, in this trigger it will update another table if DB_Main table is updated,
and it works perfectly if i try this trigger in ms sql, but when we update values from jiwa and click on save button, it shows this message
"unable to update table DB_Main" attachment added.
this is my trigger
can you please let me know how we can run our trigger without getting this message.
Thank you in advance
and it works perfectly if i try this trigger in ms sql, but when we update values from jiwa and click on save button, it shows this message
"unable to update table DB_Main" attachment added.
this is my trigger
- Code: Select all
create trigger Trigger1 on DB_Main
after update
as
begin
print 'update';
declare @jid nvarchar(50);
select @jid = inserted.DebtorID from inserted
declare @ano nvarchar(20);
select @ano = inserted.AccountNo from inserted
declare @climit nvarchar(30);
select @climit = inserted.CreditLimit from inserted
print 'jid inserted'+@jid;*/
if update(CreditLimit)
begin
update NewCrtable set CreditLimit = ''+@climit+'' where DebtorId = ''+@jid+'' and AccountNo = ''+@ano+''
end
end
go
can you please let me know how we can run our trigger without getting this message.
Thank you in advance