Skip to main content

How to Impliment pagging in SQL queries using ROW_NUMBER

 



Create  PROCEDURE dbo.GetPaggingOnProc

(

    @startRowIndex int,

    @maximumRows int

)

AS

   select RowRank,Column1,Column2,Column3 

FROM

   (

      select Column1,Column2,Column3  ,

              ROW_NUMBER() OVER (ORDER BY SADShiftCtrl) AS RowRank

       from tblTestABC

    ) AS tblTestABCWithRowNumbers

WHERE RowRank > @startRowIndex AND RowRank <= (@startRowIndex + @maximumRows)

Comments

Popular posts from this blog

Kendo UI DropDown With Multiple Check Boxes

In this blog, I will demonstrate how to create a Multiple Selection DropDownList with the help of Kendo UI. This dropdown will allow you to select more than one item and will also show the number of checked items in a dropdown list. Ex. (2 items selected). There is an option to Select all checkboxes to check all items at a time and a  Search filter is also integrated with this dropdown. Background Well, first of all, I am using a hidden field where I can put all the checked value with comma separated. This hidden field is used for managing all checked and unchecked values and keeps the values checked when the user opens the dropdown again. Below is the bunch of code. function  bindddlMultiSkill()   {       $( "#ddlMultiSkill" ).kendoDropDownList({           name:  "skill" ,           dataTextField:...

(3).Prepare c# besics and advanced questions

Question 1. What Is Attribute In C#? Answer : An attributes is a declarative tag that is used to convey information about the behaviors of various elements (classes, methods, assemblies, structures, enumerators, etc). it is access at compile time or run-time. Attributes are declare with a square brackets [] which is places above the elements. [Obsolete(“Don’t use Old method, please use New method”, true)] For example consider the bellow class. If we call the old method it will through error message. public class myClass {     [Obsolete("Don't use Old method, please use New method", true)]     public string Old() { return "Old"; }     public string New() { return "New"; } } myClass omyClass = new myClass(); omyClass.Old(); Question 2. Why Attributes Are Used? Answer : In a program the attributes are used for adding metadata, like compiler instruction or other information (comments, description, etc). C#. NET Inter...