Append the records to existing sp table
-
Hi to all, In My SP i created this table DECLARE @inc_table TABLE(ID INT identity(1,1),ModelName VARCHAR(20),Region VARCHAR(20),Tot VARCHAR) BEGIN INSERT INTO @inc_table (ModelName) SELECT ModelName FROM SRO_ModelMaster END NOw my table is fill with all modelname say, 1 PPM 2 CCP 3 MMM NOw in same table i want to add RegionCode using following statment INSERT INTO @inc_table (Region) (SELECT RegionCode FROM cmp_RegionMaster WHERE regionCode<>'TR' ) but it is inserting at the 4,5,6, id levelI want to append it to on same id that is 1,2,3 so that it gives me 1 PPM ER 2 CCP NR 3 MMM SR How i can achive this in my sp Thanks for all for yours kind suggestions.
-
Hi to all, In My SP i created this table DECLARE @inc_table TABLE(ID INT identity(1,1),ModelName VARCHAR(20),Region VARCHAR(20),Tot VARCHAR) BEGIN INSERT INTO @inc_table (ModelName) SELECT ModelName FROM SRO_ModelMaster END NOw my table is fill with all modelname say, 1 PPM 2 CCP 3 MMM NOw in same table i want to add RegionCode using following statment INSERT INTO @inc_table (Region) (SELECT RegionCode FROM cmp_RegionMaster WHERE regionCode<>'TR' ) but it is inserting at the 4,5,6, id levelI want to append it to on same id that is 1,2,3 so that it gives me 1 PPM ER 2 CCP NR 3 MMM SR How i can achive this in my sp Thanks for all for yours kind suggestions.