Hi all, -- Table 1 Declare @TblFin Table (Empid int)-- Inserting the Data in the Table 1 Insert @TblFin Select 1 Union All Select 2 Union All Select 3 Union All Select 4 Union All Select 5 Union All Select 6 Union All Select 7 Union All Select 8 Union All Select 9-- Table 2 Declare @TblBgt Table (EmpID int, PosID Int ) --Inserting the records in the Table 2 Insert @TblBgtSelect 1,1 Union All Select 2,2 Union All Select 3,3 Union All Select 4,4 Union All Select -1,5 Union All Select -1,6 Union All Select -1,7 -- Now here i want insert all the missing empids in the my second tablei.e. @TblBgt and PosID will be MAx(PosID)+1 So The Expected output when i do Select * from @TblBgt 1 12 23 34 4-1 5-1 6-1 75 86 97 108 119 12
I know this that i can do this using the Temp Tables but i dont want to use the Temp Table, is there any way to directly bluk insert the records without using Temp Tables And I cant make the PosID Column an Indentity since, the value can come from some differents ways also.. ThanksChirag