ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Execute Stored Procedure with Output Parameter in SQL Server<p>Hi <a class="username" rel="SajidHussa"> SajidHussa</a>,</p> <p>Refer below sample query.</p> <p><span style="text-decoration: underline;"><strong>SQL</strong></span></p> <pre class="brush: sql">CREATE PROCEDURE [dbo].[GetCustomers_Pager] @PageIndex INT = 1 ,@PageSize INT = 10 ,@RecordCount INT OUTPUT AS BEGIN SET NOCOUNT ON; SELECT ROW_NUMBER() OVER ( ORDER BY [CustomerID] ASC )AS RowNumber ,[CustomerID] ,[CompanyName] ,[ContactName] ,[City] INTO #Results FROM [Customers] SELECT @RecordCount = COUNT(*) FROM #Results SELECT * FROM #Results WHERE RowNumber BETWEEN(@PageIndex -1) * @PageSize + 1 AND(((@PageIndex -1) * @PageSize + 1) + @PageSize) - 1 DROP TABLE #Results END GO DECLARE @RecordCount INT EXEC [dbo].[GetCustomers_Pager] @RecordCount = @RecordCount OUTPUT</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/422941/Execute-Stored-Procedure-with-Output-Parameter-in-SQL-Server/https://www.aspforums.net:443/Threads/422941/Execute-Stored-Procedure-with-Output-Parameter-in-SQL-Server/Tue, 02 Jul 2019 03:53:27 GMT