Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Declare @Dept_no As Int; Select Select Select Select @Emp_no = i.empno From inserted i; @Emp_name = i.emp_name From inserted i; @Emp_age = i.emp_age From inserted i; @Dept_no = i.Dept_no From inserted i;
If Exists(Select empno From employee1 Where empno = @Emp_no) Begin Update employee1 Set emp_name=@Emp_name,emp_age=@Emp_age,Dept_no =@Dept_no Where empno= @Emp_no End Else Begin IF (@Emp_no Is NULL And @Emp_name Is NULL And @Emp_age Is NULL) Begin Print 'Empty Values Not Inserted' End Else Begin Insert Into employee1(empno,emp_name,emp_age,Dep t_no) Values (@Emp_no,@Emp_name,@Emp_age,@Dept_no) End End