CREATE Table #Temp ( Ind INT IDENTITY(1,1), EmpID VARCHAR(50), DOJ DATE, SAL INT, Nationality VARCHAR(50) ) DECLARE @MinIdt INT, @MaxIdt INT INSERT INTO #Temp SELECT EMPID,DOJ,SAL FROM EMP --------- FOR SOME CONDITION DECLARE @MinIdt INT DECLARE @MaxIdt INT SELECT @MinIdt = MIN(IDT), @MaxIdt = MAX(IDT) FROM #Temp WHILE @MinIdt <= @MaxIdt BEGIN -- Check 1st Condition --IF EXISTS --CHECK 2nd Condition -- IF True 3rd Condition --THEN -- check Nationality for lets say Indian 4th Condition --Update Emp table with condition -- Update one more log table --else --check for lets say NRI --Update Emp table with condition -- Update one more log table END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)