Hi @Rock Hitman ,
The result you expect can be achieved according to the following code:
ALTER PROCEDURE [dbo].[usp_GeicoData_Select]
(@poll int)
AS
Select [ID]
,[VIN]
,[Make]
,[Model]
,[Year]
,(select count(*) from [TEST].[dbo].[Ins_Data]) Ycount
FROM [TEST].[dbo].[Ins_Data]
Where [ID] between @Poll*10-9 and @Poll*10
ORDER BY [ID]
execute [dbo].[usp_GeicoData_Select] @poll=1
Test code:
alter procedure b_stu
(@poll int)
as
select EmpID,EmpName,SalaryCalc,(select count(*) from dbo.Employee ) Ycount from dbo.employee
where EmpID between @Poll*10-9 and @Poll*10
execute b_stu @poll=1
If the response is helpful, please click "Accept Answer" and upvote it.
Best Regards
Echo