IF EXISTS(SELECT * FROM [dbo].[PRoll_Company_Monthly_Salary_T_X] WHERE CompSalaryMonth =@month AND [CompSalaryYear] =@Year ) BEGIN ---DO something here END