Technical Article

Number serial Generation

,

This script generates seril numbers (0, 1, 2, 3.4,,,)
In this example I use 0 - 9999

Declare @Num Table(id int)
Insert @Num Values(0)
Insert @Num Values(1)
Insert @Num Values(2)
Insert @Num Values(3)
Insert @Num Values(4)
Insert @Num Values(5)
Insert @Num Values(6)
Insert @Num Values(7)
Insert @Num Values(8)
Insert @Num Values(9)

Select a.id +( b.id*10)+(c.id*100)+(d.id*1000)
from @Num a, @Num b, @Num c, @Num d
Order by a.id +( b.id*10)+(c.id*100)+(d.id*1000)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating