| Author |
Topic |
|
KevMull
Starting Member
11 Posts |
Posted - 2007-04-05 : 06:55:20
|
| I have a value ('MyValue') stored in a single row table ('MyTable') I need to generate a view, sp etc that will give me a list of numbers starting at 1 and then finish at the above 'Myvalue'.How Can I do this ?Many Thanks |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-04-05 : 07:05:23
|
| TSEOSD Please!Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-05 : 07:23:42
|
quote: Originally posted by harsh_athalye TSEOSD Please!Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
What does it mean?MadhivananFailing to plan is Planning to fail |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-04-05 : 07:59:01
|
| It means Table Structures, Expected Output and Sample Data please!Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
KevMull
Starting Member
11 Posts |
Posted - 2007-04-05 : 08:16:40
|
| I just need a script to generate a list (rows in view) of sequential numbers starting at 1 and ending at [MyField] FROM 'MyTable'.So if 'MyField' =5 then the view or SP would look like this..12345Thanks |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-04-05 : 09:09:31
|
| 1) SELECT Number FROM F_NUMBER_RANGE(1, 5)2) SELECT Number FROM master..spt_values WHERE Name IS NULL AND Number BETWEEN 1 AND 5Peter LarssonHelsingborg, Sweden |
 |
|
|
KevMull
Starting Member
11 Posts |
Posted - 2007-04-05 : 09:23:52
|
| Thanks Peso, but i don't follow any of that . |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-05 : 23:32:09
|
quote: Originally posted by KevMull Thanks Peso, but i don't follow any of that .
Why?MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-05 : 23:34:09
|
quote: Originally posted by harsh_athalye It means Table Structures, Expected Output and Sample Data please!Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
I see. When did you introduce this? MadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-05 : 23:35:09
|
quote: Originally posted by KevMull Thanks Peso, but i don't follow any of that .
have you tried Peter's 2nd suggestion ? KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-05 : 23:59:39
|
quote: Originally posted by khtan
quote: Originally posted by KevMull Thanks Peso, but i don't follow any of that .
have you tried Peter's 2nd suggestion ? KH
No I didnt MadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-06 : 00:00:24
|
quote: Originally posted by madhivanan
quote: Originally posted by khtan
quote: Originally posted by KevMull Thanks Peso, but i don't follow any of that .
have you tried Peter's 2nd suggestion ? KH
No I didnt MadhivananFailing to plan is Planning to fail
I did.  KH |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2007-04-06 : 09:28:44
|
| Why does everyone keep giving solutions with F_NUMBER_RANGE()? Is that a system function? If not, then maybe it would be helpful to explain to people what it is and where to find it?- Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
|
|