August 18, 2005 at 6:00 am
I need to show the row number for recordsets in functions, procedures, and views. This number will be used for formatting rows in user interface to show different colors for alternating rows
August 18, 2005 at 6:21 am
So you want the first column of a returned recordset to be row number? Not straightforward via T-SQL (although I'll wait for someone here to prove me wrong!). I would expect this sort of thing to be done by the front end app.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
August 18, 2005 at 6:29 am
It can be done... but it's the job of the presentation layer.
Just declare a int and increment it in the while not MyRs.EOF() and format using that variable.
August 18, 2005 at 3:17 pm
Err wait, Nevermind. Cant Read
Edit:
If you want to do something like this you are adding a ton of overhead onto the sql server. and if you allow client side sorting you are guaranteeing the need to hit sql server on each postback and it will make each procedure more complex because of the need for a "Dynamic" Order by.
August 18, 2005 at 4:00 pm
Don't the recordset tools have order methods in 'em?? Why don't we use 'em?? .
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply