Skip to content

Instantly share code, notes, and snippets.

@tdittmar
Created December 10, 2016 18:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tdittmar/45b02e5602ae07cb6785a1fceda791aa to your computer and use it in GitHub Desktop.
Parameterize the T-SQL TOP clause
CREATE PROCEDURE dbo.sp_TestGetAll
@LIMIT INT
AS
SELECT TOP (@LIMIT) id, col1, col2, col3 FROM TestTable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment