|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem Implementing Relational Trigger
I'm having difficulty implementing a trigger in which I am trying to make sure that no trainee is registered as being present for a class at the same time as another class already registered for, in other words no trainee can be in more than 1 place simultaneously.
The tables which the trigger is based around are: class(classno, time,...) register(traineeno, classno) Any ideas on what query I need to perform to get the correct behaviour? Last edited by markb_1984 : November 24th, 2003 at 02:59 AM. |
|
#2
|
|||
|
|||
|
could you create a UNIQUE constraint on [traineeno] AND [time] ?
|
|
#3
|
|||
|
|||
|
Sorted it out using an IF EXISTS and linking class and register on classno and inserted and class on traineeno.
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Trigger Happy DB |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|