|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, December 07, 2010 6:58 AM
Points: 115,
Visits: 17
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, December 19, 2001 12:00 AM
Points: 1,
Visits: 1
|
|
lol - ok, nicely done. Somewhat more efficient than cursors :) Why don't you just build a table and then use a between? The following example is in T-SQL as it allows the handy table var (automatically cleared after sp exec)
CREATE PROCEDURE getSubset (@start int, @end int) AS
DECLARE @tblTemp TABLE (pID int, intData int, strData nvarchar(50))
INSERT INTO @tblTemp SELECT /*insert main functionality of sp here*/
SELECT * FROM @tblTemp WHERE pID between @start and @end ORDER BY intData
Life's not difficult...enjoy it. Nood!e
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, December 07, 2010 6:58 AM
Points: 115,
Visits: 17
|
|
Thanks for your feedback. Your approach is definitely a solid option. Many ways to skin a cat.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, August 24, 2010 7:37 AM
Points: 1,
Visits: 2
|
|
what happens when the field you order by on is null for many records for example : select top 10 custnum,custname from customers where custname > (select max(custname) from customers ) A order by custname when you got many records where custname = null then the result is null resolve that please
|
|
|
|