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
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Creating a Trigger with 2 parameters

Author  Topic 

Mikebyrne
Starting Member

13 Posts

Posted - 2008-03-05 : 14:54:39
I'm using a Database called COMPANY and witihn this I have a table called Works_on.

I'm looking to create a trigger for update on Works_on that if the Hours coloum changes it MUST NOT be reduced and also that it can't be increase by more than 5%

Any idea how I can code this??

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-03-05 : 22:58:47
Possible to use check constraints instead?
Go to Top of Page

Mikebyrne
Starting Member

13 Posts

Posted - 2008-03-06 : 08:14:59
No, I have to use a trigger in this case. Not sure how to code it though
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-03-07 : 03:00:45
quote:
Creating a Trigger with 2 parameters

What do you mean by this ? Trigger cannot have input parameters.

quote:
No, I have to use a trigger in this case. Not sure how to code it though

Do you have problem with the syntax or the logic.

We will need more information like your table DDL, sample data and expected result in order to help you.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -