A more practical big data volume paging store

xiaoxiao2021-03-06  40

Create Proc sp_publicTurnPageWebsite (@tbname nvarchar (100) = ', - table name, such as Pinyin @Pagesize INT = 10, - The number of records per page, the default is 10 @curpage int = 1, - means current page 1 @Keyfield nvarchar (100) = 'ID', - Key Field name, default is ID, the field requirement is the index in the table or the field @KeyascDesc nvarchar (4) = 'asc', - Lifting, descending order, default is ascending ASC, descending is desc @fields nvarchar (500) = '*', - the selected column name, default is all @condition nvarchar (200) = ', --where conditions, default is empty @ORDER NVARCHAR (200) = '' - Sort Condition, Default As Empty) WINCRYPTION As IF @tbname = 'Begin Raiserror (' Please specify a table name! ', 11, 1) Return End if @Pagesize <= 0 or @Curpage <0 Begin Raiserror ('The number of current pages and the number of records per page must be greater than zero!', 11, 1) Return end if @keyascdesc = 'dec' set @keyascdesc = '<' Else set @keyascdesc = '>' f @condition <> 'set @condition =' where ' @Condition Declare @sql nvarchar (2000)

转载请注明原文地址:https://www.9cbs.com/read-53088.html

New Post(0)