I have an SP in which I receive a range of stock numbers and I need to insert each number in that range as a individual record in a table. Before inserting into the table I have to format the number store it as a varchar of size 10. The attributes other than this stock number would be same for all those records. I would need to insert upto 5000 such records.

For example I receive an input as 1 -100 then the resultant table should be like as below

Currently in the SP there is loop running between from and to numbers and inserting 1 record at a time. I believe there should be a better way than that. Any pointers on how I can achieve this would be great.

Florian Reischl (6/24/2009)I knew that any other constant expression should work equal. Just been unsure about the NULL.

Oh I see.I guess I started using NULL because it somehow emphasises the fact the the 'constant' isn't important or even relevant - it's just required by the syntax, as you know. There's no advantage or disadvantage to using NULL - as far as I know.Paul