How to make trigger to check that time that user choose it is empty or not?

M

Mina Essam

Guest
ALTER TRIGGER [dbo].[Check_time] on [dbo].[Schedule] after insert
AS

if exists ((select * from Schedule as S Join inserted as i on S.DDate=i.DDate AND S.ST_TIME=i.ST_TIME AND S.END_TIME=i.END_TIME))
BEGIN
print('INVALID TIME')
ROLLBACK TRANSACTION
return
END




*but there is another problem that the user can insert time before the end time for the previous user has been ended , how can i solve it?***

Continue reading...
 
Top