Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mike13
Posting Yak Master
219 Posts |
Posted - 2007-10-02 : 08:00:22
|
| Hi,What would be the easiest way create a 7 digit random nr?tnx,Mike |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-10-02 : 08:13:31
|
1) SELECT 1000000 + ABS(CHECKSUM(NEWID())) % 90000002) SELECT ABS(CHECKSUM(NEWID())) % 10000000 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
Zoroaster
Aged Yak Warrior
702 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-10-02 : 10:21:14
|
Yes it is. It has leading zeros. But you can't see them. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
Zoroaster
Aged Yak Warrior
702 Posts |
Posted - 2007-10-02 : 10:41:16
|
quote: Originally posted by Peso Yes it is. It has leading zeros. But you can't see them. E 12°55'05.25"N 56°04'39.16"
Profound. Future guru in the making. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-10-02 : 10:42:44
|
ROTFLOL!  _______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
mike13
Posting Yak Master
219 Posts |
Posted - 2007-10-02 : 17:26:26
|
| thanks a lot |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2007-10-02 : 19:50:43
|
| 8469639This number is completely random. I typed it with my eyes closed.Damian"A foolish consistency is the hobgoblin of little minds." - Emerson |
 |
|
|
Zoroaster
Aged Yak Warrior
702 Posts |
Posted - 2007-10-02 : 20:02:50
|
quote: Originally posted by Merkin 8469639This number is completely random. I typed it with my eyes closed.Damian"A foolish consistency is the hobgoblin of little minds." - Emerson
Genius! Future guru in the making. |
 |
|
|
|
|
|