>Thanks, I Used the code bit Still some records which are though exactly the same in both the tables but are not deleted in NM.
>Here is the code Which I used. I used it with Alltrim and Without Alltrim also.
>
>In NM Table Accountno is in Character and in M it is in Digits.
>
>
>
>
>Delete NM From New_Master NM inner join Master M on VAL(NM.Accountno)=M.Accountno AND ;
>ALLTRIM(NM.PhoneNo)=ALLTRIM(M.PhoneNo) and ;
>ALLTRIM(NM.Exchange)=ALLTRIM(M.Exchange) AND ALLTRIM(NM.Firstname)=ALLTRIM(M.Firstname) AND ;
>ALLTRIM(NM.Lastname)=ALLTRIM(M.LastName)
>
>
Change the above to select and see if all rows will be selected. Also, I suggest to use the other way around, e.g.
NM.AccountNo = CAST(M.AccountNo as C(10)) -- use the same type as the other table
If it's not broken, fix it until it is.
My Blog