Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

Optimising Server-Side Paging - Part II Expand / Collapse
Author
Message
Posted Tuesday, November 9, 2010 9:58 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 19, 2013 2:55 PM
Points: 3, Visits: 148
ha I knew that was coming. This is a very rudimentry example, but it gives you an idea of the issue

--create table #test (clientID int,contactID int,firstname varchar(255),lastname varchar(255),linkID int)
--insert into #test VALUES (1,1,'tim','s',1)
--insert into #test VALUES (1,1,'tim','s',2)
--insert into #test VALUES (1,1,'tim','s',2)

--select * FROM #test
;WITH
keys AS
(
SELECT DISTINCT contactID,firstname,lastname,linkID
,(SELECt count(*) FROM #test) as allrecords
FROM #test

)
SELECT * FROM keys

is that enough to make more sense of what I was saying?

Cheers

Tim
Post #1018052
Posted Thursday, November 18, 2010 2:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 19, 2013 2:55 PM
Points: 3, Visits: 148
Anyone got any thoughts on this?
Post #1022711
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse