DECLARE @PageNum AS INT;
DECLARE @PageSize AS INT;
SET @PageNum = 2;
SET @PageSize = 10;
WITH OrdersRN AS
(
SELECT ROW_NUMBER() OVER(ORDER BY OrderDate, OrderID) AS RowNum
,OrderID
,OrderDate
,CustomerID
,EmployeeID
FROM dbo.Orders
)
SELECT *
FROM OrdersRN
WHERE RowNum BETWEEN (@PageNum - 1) * @PageSize + 1
AND @PageNum * @PageSize
ORDER BY OrderDate
,OrderID;
Tuesday, 14 November 2017
Paging store Procedure to increase the performance data loading
Subscribe to:
Post Comments (Atom)
How to get logged in User's Security Roles using Java Script in dynamic CRM 365.
function GetloggedUser () { var roles = Xrm.Utility.getGlobalContext().userSettings.roles; if (roles === null) return false; ...
-
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ArrayManipulation { ...
-
CREATE Procedure SP_PaymentToSupplierEmployee_Periodically @tbl_OrganizationId nvarchar(50) AS BEGIN SET NOCOUNT ON; SELECT COUNT(...
-
CREATE TABLE [dbo].[tbl_dbLogs]( [LogSerialId] [int] IDENTITY(1,1) NOT NULL, [Error_line] [int] NULL, [ERROR_MESSAGE] [nvarchar](max...
No comments:
Post a Comment