insert tcardnodetail (fid,fcompid,fcardno,fsectionno,fstate,fusetime,fuserid) select dbo.fnnewid(),1,right(10001+number,4),'',0,null,0 from master..spt_values where type = 'p'