this procedure may u help
create PROCEDURE [dbo].[Procedurename]
(
@strCompanyid varchar(22)
,@lngPreviousYear int
,@Txt_Employee varchar(22)
)
as
begin
select sum(sal_det_amt) as reimbursement from salary_details where sal_det_desc IN (
select comp_set_desc from companyinfo where comp_id =@strCompanyid
and comp_set_type = 'Earnings' and comp_set_deleted = 1 and sal_isdeduct = 0 )
and sal_id IN (select sal_id from salary_master where sal_deleted = 0
and sal_Year = @lngPreviousYear and comp_id = @strCompanyid
and emp_code = @Txt_Employee)
end