alter proc AddJob @ID int, @Gro_Amaliat_ID int, @name nvarchar(100), @sharh nvarchar(100) as begin if not exists(select ID from amaliatesystem where ID=@ID) insert into AmaliateSystem (ID,name,Gro_Amaliat_ID,sharh)values(@ID,@name,@Gro_Amaliat_ID,@sharh) else update amaliateSystem set name=@name, Gro_Amaliat_ID=Gro_Amaliat_ID, sharh=@sharh where ID=@ID end