Skip to content

Instantly share code, notes, and snippets.

@sqlparser
Created April 8, 2014 07:36
Show Gist options
  • Save sqlparser/10099814 to your computer and use it in GitHub Desktop.
Save sqlparser/10099814 to your computer and use it in GitHub Desktop.
SQL parameter declaration
CREATE FUNCTION dbo.Fn_gettoporders(@custid AS INT,@n AS INT, @test AS CHAR)
RETURNS TABLE
AS
RETURN
SELECT TOP(@n) *
FROM sales.salesorderheader
WHERE customerid = @custid
ORDER BY totaldue DESC
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment