how to do insertion in if and else condition of Triggers in sql server : create trigger thequery4 on employees
instead of insert,delete
as
declare @var3 int

select @var3=d.D_ID  from inserted d,DEPARTMENTS dp where d.D_ID=dp.D_ID
if( @var3 is null)
begin
print 'you are NOT  allowed , B/C IS Its d_Id is not present in department '
end
else
begin
----insertion----
end