⌘BABAKOV.NET Let's code!
100% [light] [ru]

Example of Choosing a Certain Number of Numbered Records in MSSQL

This example can be useful when you need to choose a certain number of numbered records from somewhere and insert them into a temporary table or table variable.

Example:

select number as Section from master..spt_values where type=\'L\' and number>0 and number<=100

Example outputs 100 rows of the table with values from 1 to 100 and a single column Section.

Comments (0)

No comments yet.

Leave a comment
Comment
Images (up to 5 MB)
Your comment will appear after moderation.