3 Star 0 Fork 0

Han_Mars/Phone_ExhiBit

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
导航分页存储过程.sql 734 Bytes
Copy Edit Raw Blame History
hehe authored 2017-03-11 11:24 . no commit message
CREATE PROC Pro_NaviGation
(
@PageIndex int,
@PageSize int,
@NaviName varchar(20)
)
AS
DECLARE @PageSql varchar(2000)
BEGIN TRY
SET @PageSql='SELECT TOP ' + CAST(@PageSize as varchar)
SET @PageSql +=' * FROM (
SELECT ROW_NUMBER() OVER (ORDER BY NaviId) ROWID,
* FROM NaviGation '
IF (@NaviName!='')
SET @PageSql+=' WHERE NaviName LIKE ''%'+@NaviName+''''
SET @PageSql+=') K '
SET @PageSql+=' WHERE ROWID >'+CAST(((@PageIndex - 1)*@PageSize + 1) AS VARCHAR)
SET @PageSql+=' SELECT COUNT(*) FROM NaviGation'
IF (@NaviName!='')
SET @PageSql+=' WHERE NaviName LIKE ''%'+@NaviName+''''
PRINT(@PageSql)
EXEC(@PageSql)
END TRY
BEGIN CATCH
DECLARE @MSG varchar(500)=error_message()
PRINT @MSG
END CATCH
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/hanyaoguo/Phone_ExhiBit.git
git@gitee.com:hanyaoguo/Phone_ExhiBit.git
hanyaoguo
Phone_ExhiBit
Phone_ExhiBit
master

Search