Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Trigger to increment the salary by 10%

Author  Topic 

hussainzim
Starting Member

21 Posts

Posted - 2007-09-25 : 04:13:20
i want to write a database trigger to increment the salary by 10% for technicians who have done three tests on a particular date.

there are two employee types.(1)technicians (2)traffic controllers.
employee category is defined in "Type" attribute of Employee table. the increment should happen only to technicians.thank you in advance.

Employee (EmployeeID,Name,Salary,Tpye)
TestEvent(TestNo,EmployeeID,TestDate)

Hussain

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-09-25 : 04:18:32
Why you are doing this in trigger? Why not handle this from insert/update proc?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-09-25 : 04:38:20
If you do do it as a trigger you will need to know that the salary increase has been done - otherwise they will get a 10% pay rise every time that record is updated (once they have done three tests)!

Kristen
Go to Top of Page
   

- Advertisement -