let's me give a short description before jump to it
@@ROWCOUNT will going to show the exact number of rows that affected by the last SQL statement, it is best way to capture it into a local variable following the command in question, as its value will change the next time you look at it:
DECLARE @NRows int
DECLARE @MTable table (cl1 int, cl2 int)
INSERT INTO @MTable (cl1, cl2) select 1,2 union select 3,4
SELECT @NRows=@@ROWCOUNT
SELECT @NRows AS NRows,@@ROWCOUNT AS [NUMBEROFROW]
As A Result should be like this
I hope this is helpful
0 comments:
Post a Comment