为什么要使用全局临时表?为什么不直接从过程中返回结果呢?例如:
CREATE PROCEDURE usp_SalesRefCount
AS
BEGIN
DECLARE @NumRecs INT;
SELECT @NumRecs = COUNT(Recommendation)
FROM [Master_AGGREGATE].[dbo].[Recommendations]
WHERE Recommendation = '____Document DOB in pt record'
and SalesProcessTime > '2018-10-20'
SELECT @NumRecs NumRecs
END