• If you require the number of rows at the output from the proc then try this:

    create Procedure dbo.RecCount (@Table as nvarchar(100)) As

    Begin

        DECLARE @cntTotal varchar(10)

        DECLARE @sql nvarchar(400)

        set @sql = N'select @cnt=count(*) from ' + @Table

        exec sp_executesql @sql, N' @cnt varchar(10) output', @cnt=@cntTotal output

        select @cntTotal

    End