Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
update Attendence set Att_UpdateBit='0'
where fk_Att_EmpCode   In (select pk_Emp_Code
                           from EmployeeMaster
                           where ((@ATReprs_Location='All') or (fk_Emp_LocCode=@ATReprs_Location)) and
                             ((@ATReprs_Catagory='All')or (fk_Emp_CatCode=@ATReprs_Catagory)) and
                             ((@ATReprs_Department='All') or (fk_Emp_DepCode=@ATReprs_Department)))and
                                Att_Date>=@ATreprs_Fromdate and Att_Date<=@ATreprs_Todate
    

 here i am using store procedure and i am paasing parameter  and i am updating one table column from comparing other table condition with condition .Its Working  fast only 50 employe ,,but if i update using "excel upload It will tak eso much time after it show "sql query time out " please can any one help me
Posted
Updated 14-Apr-14 2:39am
v2

1 solution

Follow the below code:

SQL
update atten set atten.Att_UpdateBit='0' from Attendence atten
 join EmployeeMaster Emp on (Emp.@ATReprs_Location=atten.fk_Emp_LocCode or Emp.@ATReprs_Location='All')  and
 (atten.fk_Emp_CatCode=Emp.@ATReprs_Catagory  or Emp.@ATReprs_Catagory='All')
 and(atten.fk_Emp_DepCode=Emp.@ATReprs_Department or  Emp.@ATReprs_Department='All')
 where  Att_Date>'some date'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900