这里只是我想知道临时表中的记录数并传递给另一个变量,以便它在执行计划表扫描中显示大约 100%
请找到我正在做的以下查询
DECLARE @tmpANHdr TABLE (
hdrId INT IDENTITY,
CBFId NVARCHAR(32),
ACPT_REJ_FLAG NVARCHAR(8),
PROC_FILE_NAME NVARCHAR(50))
INSERT INTO @tmpANHdr
SELECT TOP 100 AHR_CB_FTS_FILE_ID,
AHR_ACCT_REJ_FLAG,
AHR_PROC_FILE_NAME
FROM FTS_ACK_NAK_HEADER WITH (NOLOCK)
WHERE AHR_FLAG IS NULL
OR AHR_FLAG = 0
DECLARE @varRecordCount INT
SELECT @varRecordCount = Count(1)
FROM @tmpANHdr
SET @varIndex = 1
IF( @varIndex <= @varRecordCount )
BEGIN
PRINT 'hi'
END