create table Countcol
(
idx int identity(1,1) primary key,
ACount int,
BCount int
)
Create View v_Col
as
Select idx, Acount, BCount, (ACount+BCount) as CCount From CountCol
Declare @A int
Declare @B int
Set @A=20
Set @B=30
While @A<50 Begin
Set @A=@A+1
Set @B=@B+3
insert CountCol(Acount, BCount) values(@A,@B)
End
Select * from CountCol
Select * from v_Col
Select idx, Acount, BCount, (ACount+BCount) as CCount From CountCol