Build the Numbers Table You Need | Database Journal

Build the Numbers Table You Need

Feb 24, 2009
1 minute read

[From SQL Server Magazine]

CreateIntegersTable is a multistatement table-valued function written for Microsoft SQL Server 2005. You can use this custom tool to create a numbers table that works around nearly all the limitations that traditional techniques for building these tables usually involve. For example, traditional techniques might themselves involve cursors, loops, or identity columns. The techniques might need temporary tables or actual database tables, which could place expensive demands on database server resources, and the techniques usually lack the flexibility for a developer who needs a different kind of numbers table: one that has starting—and maybe ending—negative values or increment values greater than 1. CreateIntegersTable skirts nearly all these drawbacks.

The article continues at

http://www.sqlmag.com/Articles/ArticleID/100531/100531.html?Ad=1

Database Journal Logo

DatabaseJournal.com publishes relevant, up-to-date and pragmatic articles on the use of database hardware and management tools and serves as a forum for professional knowledge about proprietary, open source and cloud-based databases--foundational technology for all IT systems. We publish insightful articles about new products, best practices and trends; readers help each other out on various database questions and problems. Database management systems (DBMS) and database security processes are also key areas of focus at DatabaseJournal.com.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.