2012-06-21 2 views
1

quand je fais la pagination pour MS SQL Server à utiliser avec datatable jquery j'écris simple sp comme celui-cipagination Cassandra avec C#

create PROCEDURE [dbo].[Get_SomeData] (
@startRowIndex BIGINT, @maximumRows BIGINT ,@sSearch VARCHAR(MAX),@total INT OUTPUT 
) 
AS 


DECLARE @temp TABLE(RowRank BIGINT,custid BIGINT,names VARCHAR(500)) 

INSERT INTO @temp 
    SELECT ROW_NUMBER() OVER (ORDER BY custid) AS 
    RowRank,custid,names FROM dbo.SomeTable WHERE (names LIKE '%'[email protected]+'%' ) 

    SELECT @total=COUNT(custid) FROM @temp 

SELECT * FROM @temp WHERE RowRank > @startRowIndex 
AND RowRank <= (@startRowIndex + @maximumRows) 

Cela rend plus facile à parcourir les données par incrémenter @startRowIndex. Mais comment réaliser la même chose de pagination avec une base de données Cassandra et un client aC# comme fluentcassandra (ou n'importe quelle bibliothèque client C#)

Répondre