Snowflake Vs MS-SQL - Part 57 - Affected Rows - SQLROWCOUNT
Affected Rows - SQLROWCOUNT
DML commands are part of our day-to-day life. After DML command execution if
you want to get the number of records executed you can get it by row count.
In this case, you are inserting 6 records in a table and you should get that count
i.e. six.
INSERT INTO Main_Table (store_ID, province, profit)
VALUES
(1, 'Ontario', 500),
(2, 'Saskatchewan', 500),
(3, 'Ontario', 450),
(4, 'Ontario', 450),
(5, 'Saskatchewan', 450),
(6, 'USA', 650)
;
MS-SQL Server
You can achieve this by using System Variable @@RowCount as below.
similar variable SQLROWCOUNT.
For more details, you can refer to the following SQLROWCOUNT.
Comments
Post a Comment