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 |
|
aiken
Aged Yak Warrior
525 Posts |
Posted - 2002-01-02 : 02:08:11
|
Is there any way to do a dynamic TOP count without resorting to dynamic SQL (or dynamically creating stored procedures, etc). Something like:select top @iRowCount login_name from users where... Thanks-b |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-01-02 : 02:16:20
|
| hmmm, you could have this answered if you only spent 20 seconds searching the site and the forums...Use SET @@Rowcount = @myvalSELECT * from TableSET @@Rowcount = 0Damian |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-01-02 : 09:26:00
|
set rowcount @myvalselect * from Tableset rowcount 0 .==========================================Cursors are useful if you don't know sql.Beer is not cold and it isn't fizzy.Edited by - nr on 01/02/2002 09:26:51 |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-01-02 : 09:28:23
|
oooopsThat's embarassing Yet another reason to look up syntax in books online Damian |
 |
|
|
|
|
|