这是存储过程的部分脚本。我希望能够自动更新(下面的数据结果)下一个“P4”(等等)列数:
/*
RESULTS:
66,
221,
0
*/
DECLARE
@APP_TOTAL INT
, @DB_TOTAL INT
, @OS_TOTAL INT
, @YEAR INT
SET @APP_TOTAL = (SELECT COUNT(*)
FROM [db_eCAM].[dbo].[tbl_SecChecks]
WHERE LAYER = 'APP' AND [ENABLE] = 1)
PRINT @APP_TOTAL
SET @DB_TOTAL = (SELECT COUNT(*)
FROM [db_eCAM].[dbo].[tbl_SecChecks]
WHERE LAYER = 'DB' AND [ENABLE] = 1)
PRINT @DB_TOTAL
SET @OS_TOTAL = (SELECT COUNT(*)
FROM [db_eCAM].[dbo].[tbl_SecChecks]
WHERE LAYER = 'OS' AND [ENABLE] = 1)
PRINT @OS_TOTAL
SET @YEAR = 2013