Hi,Below are my temp tables--DROP TABLE #Base_Resource, #Resource, #Resource_Trans;SELECT data.* INTO #Base_Resource FROM ( SELECT '11A','Samsung' UNION ALL SELECT '12A','Nokia' UNION ALL SELECT '13A', 'Alcatel' UNION ALL SELECT '14A', 'Motorolla' UNION ALL SELECT '15A', 'ChinaSets' UNION ALL SELECT '16A', 'Apple' ) data (Resourcekey, value);create table #Resource (StringId Int identity(1,1) primary key,Resourcekey varchar(50));create table #Resource_Trans (TransId Int identity(1,1) primary key,StringId int, value
I want to loop through the data from #Base_Resource and do the follwing logic.1. get the Resourcekey from #Base_Resource and insert into #Resource table2. Get the SCOPE_IDENTITY(),value and insert into to#Resource_Trans table's column(StringId,value)I am able to do this using while loop. Is there any way to avoid the while loop to make this work? Any suggestions or samples please