Skip to content
Advertisement

How to create a trigger for this situation?

I have a problem inserting values into a Class table.

I want to write a trigger to prevent happening “an instructor teaches in different class_Id at the same time”.

How can I do this?

This is the trigger which I’ve created:

Advertisement

Answer

Use inserted and JOIN to the Class table. Check for existence of rows in table that matches your requirement (c_DayOfClass, c_TermSeason etc)

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement