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 |
|
Eagle_f90
Constraint Violating Yak Guru
424 Posts |
Posted - 2007-12-30 : 21:28:10
|
| I tried using the search to find the answer but they all referance doing it with a numbered column. What I want to is open Table and return a single random row of data. I would use the Random command but that deals with numbers and there is no number row. All data has an Alpha based name. Any suggestions?-- If I get used to envying others...Those things about my self I pride will slowly fade away.-Stellvia |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-12-30 : 22:29:03
|
| SELECT TOP 1 *FROM YourTableORDER BY NEWID()Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
Eagle_f90
Constraint Violating Yak Guru
424 Posts |
Posted - 2007-12-31 : 11:31:40
|
| Thanks, I ran across that code in my search but it did not have the newid() tag.-- If I get used to envying others...Those things about my self I pride will slowly fade away.-Stellvia |
 |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-12-31 : 23:18:52
|
| It's new function in sql2k5. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-01-01 : 03:28:06
|
| NEWID() isn't new to 2005. It was available in 2000 too.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|
|