更新时间:2023-02-07 18:26:17
将@@ ROWCOUNT捕获到一个变量中,因为每次选择它都会改变值:
capture @@ROWCOUNT into a variable, because it will change values each time you select it:
DECLARE @Rows int
---your query here
SELECT @Rows=@@ROWCOUNT
然后您可以根据需要将其用作@Rows
you can then use it as necessary as @Rows