Created
July 11, 2013 18:34
-
-
Save anonymous/5977962 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE [dbo].[getClients] | |
@filterString varchar(25), | |
@start int, | |
@limit int | |
AS | |
BEGIN | |
SET NOCOUNT ON; | |
SELECT TOP (@limit) | |
clientId, | |
clientName | |
FROM | |
( | |
SELECT ROW_NUMBER() OVER (ORDER BY clientName) as RowNum, clientId, clientName | |
FROM dbo.Clients | |
WHERE clientName like @filterString + '%' | |
) as RowConstrainedResult | |
WHERE | |
rowNum > @start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment