Sql Server SELECT & SET ROWCOUNT

Sql Server SELECT & SET ROWCOUNT

Post by Shyam Bhandar » Sat, 21 Apr 2001 15:16:29



Is there any SELECT method in SQL SERVER so that we can get the specified
number of records from starting row to ending row. Or can we set the
starting record number for the command SET ROWCOUNT in Microsoft SQL Server.

e.g. Suppose we want total Y records starting from Xth.

Thanks, Shyam
--

BLUE STAR INFOTECH LIMITED
VIDYADEEP, 128/1, Ulsoor Road,
Banglore - 560042, KA, INDIA.
PH (BSIL) : 080-5591537, 5594663 (Ext. 104)
PH (HP) : 080-2251554 (Ext. 1512)
FAX : 91-80-5581263

 
 
 

1. SELECT BOTTOM and SET ROWCOUNT

I know there isn't a SELECT BOTTOM, and that in order to get this you should
SELECT TOP with the ORDER BY DESC.  My question is, is there a way to get the
bottom x yet reverse the order before displaying.  Would I have to create a view
(sub-select) to do this or is there an easier way?

Also, if inside of a stored procedure I set the rowcount to some value (let's
say 10) and run the query.  If another user is calling a different procedure
would their return set be 10?  In other words, is the ROWCOUNT global?  From
what I've heard you are suppose to set the ROWCOUNT back to 0 before leaving a
procedure, so that seems to mean that it is global.

Joe Mumbauer.

2. xml4Analysis Drillthru Error

3. SET ROWCOUNT vs. SELECT TOP challenge

4. grant privileges to a database [URGENT]

5. SELECT TOP v SET ROWCOUNT

6. pgsql-server/src backend/catalog/Tag: backend/ ...

7. Setting limited rowcount in selects

8. Oracle NT - cant start listiner

9. SET ROWCOUNT set by ODBC...

10. SQL 6.0/ 6.5 set rowcount @variable generates error

11. XP_CMDSHELL @@ROWCOUNT not set with SQL Agent???

12. rowcounting in SQL result set

13. Date Format & SQL Server Character Set