April 28, 2008 at 11:56 pm
[font="Verdana"]
...and I had programatically implemented paging in asp.net by looping through all records returned by the query...
If you have Asp. Net as fron end, then what cause you to do the looping the records? Asp. Net has Datagrid control where you could have done pagging easily. You need to just bind the data to Datagrid, no need to loop more.
Mahesh
[/font]
MH-09-AM-8694
April 29, 2008 at 10:06 pm
And if the query returns a million rows, then what?
--Jeff Moden
Change is inevitable... Change for the better is not.
May 12, 2008 at 6:18 am
Your Solution is here, Please change the SELECT Queries with your Query
SELECT * , ROW_NUMBER() OVER(ORDER BY ID) AS MY_ROW_NUM FROM
(
SELECT ID, FirstName, LastName, JoinDate FROM Table1
UNION
SELECT ID, FirstName, LastName, JoinDate FROM Table2
)
SUB
May 12, 2008 at 6:34 am
ahsansharjeel (5/12/2008)
Your Solution is here, Please change the SELECT Queries with your QuerySELECT * , ROW_NUMBER() OVER(ORDER BY ID) AS MY_ROW_NUM FROM
(
SELECT ID, FirstName, LastName, JoinDate FROM Table1
UNION
SELECT ID, FirstName, LastName, JoinDate FROM Table2
)
SUB
Again, I ask, what if you have a million rows?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 14, 2010 at 8:48 am
Add simiar to this, It works
SELECT (ROW_NUMBER() OVER (Order By EMPID1 ))AS SrNo,*
( UNION Queries)
July 14, 2010 at 9:05 am
Please note: two year old thread.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 14, 2010 at 9:24 am
Forum ghosts resurrecting threads! Arch! :-D:-D:-D
Viewing 7 posts - 16 through 21 (of 21 total)
You must be logged in to reply to this topic. Login to reply