第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

SQL2005 中set 設(shè)置默認(rèn)參數(shù) 不執(zhí)行

SQL2005 中set 設(shè)置默認(rèn)參數(shù) 不執(zhí)行

慕村225694 2018-12-06 21:26:56
USE [data_smf]GO/****** 對象:? StoredProcedure [dbo].[page]??? 腳本日期: 01/10/2011 15:01:29 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO-- =============================================-- Author:??<Author,,Name>-- Create date: <Create Date,,>-- Description:?<Description,,>-- =============================================ALTER PROCEDURE [dbo].[page]@key int=0, --返回總頁數(shù)或數(shù)據(jù)@value nvarchar(50)='-',--用于排序字段@size int=20, --每頁顯示數(shù)據(jù)的條數(shù)@order nvarchar(50)='asc',@table nvarchar(50),@column nvarchar(100)?AS ?SET NOCOUNT ON;--declare @KEYS intdeclare @sqlstr1 nvarchar(2000)declare @sqlstr2 nvarchar(2000)declare @sqlstr3 nvarchar(2000)--set @KEYS=@keyset @sqlstr1='select RowNumber=ceiling(count(id) *1.0/'+cast(@size as nvarchar(20))+')from ' +@table +' '--總頁數(shù)set @sqlstr2= 'select '+@column+' from (select row_number() over(order by '+@value+' '+@order+? ' ) as RowNum, *? from? '+@table+' ) t where t.RowNum between 20*('+cast(@key as nvarchar(20))+'-1) and 20*'+cast(@key as nvarchar(20))+'order by '+' '+@value+' '+@order+' ' --id可以被替換 BEGIN--返回總行數(shù)if(@key=0)beginexec(@sqlstr1)end--返回調(diào)用頁的數(shù)據(jù)?if(@key>0 and @value<>'-')begin? exec(@sqlstr2)end--返回總頁數(shù),并且返回第一頁數(shù)據(jù)if(@key=-1)beginexec(@sqlstr1)-- 設(shè)置key 值無效set @key=1?exec(@sqlstr2) endEND ?
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 582 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號