while sending request parameter to this stored procedure
i need to insert an department _id ,fy_id, vertical_id , while inserting .Before that i set one temp int variable and then assign it to query
And checking the condition of temp variable if temp variable is 0 then could not only value isto be inserted
ALTER PROCEDURE [dbo].[insert_approved_man_power](
@fy_id INT ,
@department_id INT ,
@approved_man_power INT,
@login_id nchar(10),
@login_dt smalldatetime ,
@vertical_id INT)
AS
declare @temp int
set @temp = 0
set @temp = select department_id from approved_man_power where department_id != @department_id and fy_id != @fy_id and vertical_id != @vertical_id
if @temp = 0
BEGIN
INSERT INTO approved_man_power(fy_id,department_id,approved_man_power,login_id,login_dt,vertical_id)
VALUES (@fy_id,@department_id ,@approved_man_power,@login_id,@login_dt,@vertical_id)
END