How could I write a stored procedure to get the percentages from dynamic columns and insert all of that into a new table? This table would grow once a month so Dec would be added next and so on. I would want to have all of the percentages for each month listed. So that column could be called Oct 10 Perc, Nov 10 Perc and so on. Is this even possible?
Oct 10 Perc Oct10icnt Oct10ncnt Oct10tnct Nov 10 Perc Nov10icnt Nov10ncnt Nov 10 tnct
50 40 90 150 60 210
CREATE TABLE [dbo].[iClaims](
[Oct 10 iCnt] [int] NULL,
[Oct 20 nCnt] [int] NULL,
[Oct 10 tCnt] AS [int]
[Nov 10 iCnt] [int] NULL,
[Nov 20 nCnt] [int] NULL,
[Nov 10 tCnt] AS [int]
) ON [PRIMARY]
insert into iclaims
select '50', '40', '90', '150', '60', '210'
Oct 10 Perc Oct10icnt Oct10ncnt Oct10tnct Nov 10 Perc Nov10icnt Nov10ncnt Nov 10 tnct
50 40 90 150 60 210
CREATE TABLE [dbo].[iClaims](
[Oct 10 iCnt] [int] NULL,
[Oct 20 nCnt] [int] NULL,
[Oct 10 tCnt] AS [int]
[Nov 10 iCnt] [int] NULL,
[Nov 20 nCnt] [int] NULL,
[Nov 10 tCnt] AS [int]
) ON [PRIMARY]
insert into iclaims
select '50', '40', '90', '150', '60', '210'