General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
I am trying to add code to my update trigger to calculate a annual, hourly and pay freq amount to store back to the table. After I calculate the values I have to following update:
update ee_job set
salary = @salary,
hour_rate = @hour_rate,
freq_rate = @freq_rate
where job_id = (select job_id from inserted)
This works fine if I am updating a sinlge record... but, if I try to run a select like...
update ee_job set mode = mode
to get the data in all records updated, I am told that the subquery returns more than one record. How can I limit the select into inserted to match the record that I am working with in the trigger?
Thanks,
BOb
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only