as startted int he title: in sql2005 what is master.dbo.spt_values and how do you use it?
Asked
Active
Viewed 930 times
1
-
possible duplicate of [What is the purpose of system table table master..spt_values and what are the meanings of its values? ](http://stackoverflow.com/questions/4273723/what-is-the-purpose-of-system-table-table-master-spt-values-and-what-are-the-m) – Joe Stefanelli Jan 24 '11 at 17:27
1 Answers
1
I've no idea what its actual purpose is but you will often see it pressed into service as a handy adhoc numbers table with numbers between 0-2047.
select number from master..spt_values where type='P'
Some examples of where this would be useful are listed here: Why should I consider using an auxiliary numbers table?
For your own code you are much better off creating your own permanent indexed numbers table though.

Community
- 1
- 1

Martin Smith
- 438,706
- 87
- 741
- 845