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 |
|
GoDaddy
Yak Posting Veteran
64 Posts |
Posted - 2009-08-06 : 13:53:29
|
| I'm looking at a more elegant way to do the following : CREATE SP@top int = NULLASif @top is not nullBEGINselect TOP @top * FROM EmployeesENDelseselect * FROM Employees |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-08-06 : 13:59:30
|
One option:declare @rc intset @rc = isNull(@top, 0)set rowcount @rcselect <colList> from employees order by <something>set rowcount 0 You could also look int "server side paging" techniquesBe One with the OptimizerTG |
 |
|
|
|
|
|