Get the App
SLTechnology News&Howtos  ›  Database  › 

How to optimize paging stored procedure in sqlserver

Shulou Source: shulou.com Published: 2022-05-31 19:25:55 10月03日 Update

sqlserver how to optimize the paging storage process, I believe that many inexperienced people are helpless about this, this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

The code is as follows: --CODE ONE DECLARE @cc INT SELECT NewsId,ROW_NUMBER() OVER(ORDER BY SortNum DESC) AS RowIndex INTO #tb FROM news WITH(NOLOCK) WHERE NewsTypeId=@NewsTypeId AND IsShow=1 SET @cc = @@ROWCOUNT SELECT n.* FROM news AS n WITH(NOLOCK), #tb As t WHERE t.RowIndex>@PageIndex*@PageSize AND t.RowIndex@PageIndex*@PageSize AND t.RowIndex

Tags: Code physics logic influence process storage content efficiency methods more and more more and more problems more and more obvious helpless for this information reason originally to this Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Information NVidia vpn Huawei