Counting the number of rows returned by stored procedure

前端 未结 7 1746
礼貌的吻别
礼貌的吻别 2021-01-03 23:11

How do I count the number of rows a stored procedure would return the fastest way. Stored procedure returns rows around 100K to 1M records.

7条回答
  •  梦谈多话
    2021-01-03 23:33

    You can define output variable:

    create procedure x
        (@p1 int output)
    as
        select @p1 = count(*) 
        from Table
    

提交回复
热议问题