zoukankan      html  css  js  c++  java
  • 成熟sql 分页存储过程(UP_General_GetRowCount)

    View Code
     1 GO
    2 /****** Object: StoredProcedure [dbo].[UP_General_GetRowCount] Script Date: 03/17/2011 11:17:19 ******/
    3 SET ANSI_NULLS ON
    4 GO
    5 SET QUOTED_IDENTIFIER ON
    6 GO
    7 ALTER PROCEDURE [dbo].[UP_General_GetRowCount]
    8 @strTable nvarchar(255), -- 表名
    9 @strField nvarchar(1000) = '*', -- 需要返回的列
    10 @strWhere nvarchar(255)='', -- 排序的字段名
    11 @RowCount int output -- 返回记录总数
    12 AS
    13
    14
    15 declare @strSQL nvarchar(4000) -- 主语句
    16 set @strSQL = 'select @RowCount=ISNULL(count(*),0) from ' + @strTable + ' where 1=1 '+@strWhere
    17 exec sp_executesql @strSQL,N'@RowCount int output',@RowCount out

  • 相关阅读:
    leetcode680
    leetcode558
    leetcode840
    leetcode703
    leetcode836
    leetcode704
    leetcode849
    leetcode707
    2019-10-26-Inno-Setup-安装包脚本-Run-的-Flags-标记
    2019-8-30-C#-从零开始写-SharpDx-应用-笔刷
  • 原文地址:https://www.cnblogs.com/yeminglong/p/2212919.html
Copyright © 2011-2022 走看看