in sql2005 what is master.dbo.spt_values and how do you use it?
as startted int he title: in sql2005 what is master.dbo.spt_values and how do you use it?开发者_如何转开发
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.
精彩评论