Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,

I my web application, I need to update 'JOB STATUS' field which was in another(JOBSHEET) table after BILLING table affected.

I use the trigger as follows...

SQL
ALTER trigger [dbo].[TR_JOBSTATUS]
on [dbo].[Billing] After INSERT
As
Begin
declare @jobchdid as nvarchar(5)

select @jobchdid = i.Jobchdid from inserted i

Update dbo.Jobsheet set
[status] = 'BILLING MADE' where
jobchd_id = @jobchdid
End
Posted
Updated 29-Jan-12 23:51pm

1 solution

Bug is here


declare @jobchdid as nvarchar(5)


Actually jobchdid length is nvarchar(50)...

Now its works fine
I have solved myself....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900