【SQL开源代码栏目提醒】:网学会员--在 SQL开源代码编辑为广大网友搜集整理了:TaskList_GetNumberOfItemsToDisplayPerPage.sql绩等信息,祝愿广大网友取得需要的信息,参考学习。
-- =============================================
-- TaskList_GetNumberOfItemsToDisplayPerPage
-- =============================================
-- Retrieves the number of task list items to display per page on the task list
-- for the user specified
IF EXISTS (SELECT name
FROM sysobjects
WHERE name = N'TaskList_GetNumberOfItemsToDisplayPerPage'
AND type = 'P')
DROP PROCEDURE TaskList_GetNumberOfItemsToDisplayPerPage
GO
CREATE PROCEDURE TaskList_GetNumberOfItemsToDisplayPerPage
@Username VarChar(20),
@PasswordHash VarChar(50)
AS
DECLARE @CurrentUserID BigInt, @NumberOfItems VarChar(20)
SET @CurrentUserID = NULL
SELECT @CurrentUserID = ID, @NumberOfItems = ItemsToDisplay
FROM TaskListUsers
WHERE Username = @Username AND Pass
wordHash = @PasswordHash
IF (@CurrentUserID IS NULL) Return 1;
IF (@NumberOfItems IS NULL)
SELECT 'All' AS NumberOfItems;
ELSE
SELECT @NumberOfItems AS NumberOfItems;