标签:
初始化主表数据 declare @i int set @i=2010 while @i<2030 begin insert into OA_Merchants_SaleStatusMain ([Year]) values(@i) set @i=@i+1 end 初始化从表 drop table #tempt1; select * into #tempt1 from OA_Merchants_SaleStatusDetails declare @a int set @a=5 while @a<25 begin insert into OA_Merchants_SaleStatusDetails([MainID] ,[Month] ,[CompanyProportion]) select @a,[Month] ,[CompanyProportion] from #tempt1 set @a=@a+1 end
标签:
原文地址:http://www.cnblogs.com/JJ.Net/p/4332632.html