Code
declare @myCount int
execute Company_ListCount
大致就是要吧 Company_ListCount 这个存储过程的值(这里返回的是数字) 赋给@myCount
不能改动那个存储过程
Declare @myCount int
Exec [Company_ListCount ],@myCount OUTPUT
Select @MyCount
create PROCEDURE [dbo].[Company_ListCount]
AS
Declare @myCount int
SELECT @myCount = count(*) FROM Company
return @myCount
---------------------------
declare @myCount int
set @myCount = execute Company_ListCount
Code
declare @myCount int
set @myCount = execute Company_ListCount
select @myCount