Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
This is possible in SQL Server using the built-in @@ROWCOUNT variable. Something like this DECLARE @rows INT = 0; -- INSERT ... SET @rows = @rows + @@ROWCOUNT; -- UPDATE ... SET @rows = @rows + @...
Answer
#4: Post edited
This is possible in SQL Server using the built-in [`@@ROWCOUNT`](https://docs.microsoft.com/en-us/sql/t-sql/functions/rowcount-transact-sql) variable. After each `UPDATE`, you'd- SET @rows = @rows + @@ROWCOUNT;
- MySQL has the [`FOUND_ROWS()`](https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_found-rows) function, but it only works on `SELECT`s.
- This is possible in SQL Server using the built-in [`@@ROWCOUNT`](https://docs.microsoft.com/en-us/sql/t-sql/functions/rowcount-transact-sql) variable. Something like this
- DECLARE @rows INT = 0;
- -- INSERT ...
- SET @rows = @rows + @@ROWCOUNT;
- -- UPDATE ...
- SET @rows = @rows + @@ROWCOUNT;
- -- DELETE ...
- SET @rows = @rows + @@ROWCOUNT;
- -- SELECT ...
- SET @rows = @rows + @@ROWCOUNT;
- SELECT @rows AS Rows
- MySQL has the [`FOUND_ROWS()`](https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_found-rows) function, but it only works on `SELECT`s.
#3: Post edited
This is possible in SQL Server using the built-in [`@@ROWCOUNT`](https://docs.microsoft.com/en-us/sql/t-sql/functions/rowcount-transact-sql) function. After each `UPDATE`, you'd- SET @rows = @rows + @@ROWCOUNT;
- MySQL has the [`FOUND_ROWS()`](https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_found-rows) function, but it only works on `SELECT`s.
- This is possible in SQL Server using the built-in [`@@ROWCOUNT`](https://docs.microsoft.com/en-us/sql/t-sql/functions/rowcount-transact-sql) variable. After each `UPDATE`, you'd
- SET @rows = @rows + @@ROWCOUNT;
- MySQL has the [`FOUND_ROWS()`](https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_found-rows) function, but it only works on `SELECT`s.
#2: Post edited
- This is possible in SQL Server using the built-in [`@@ROWCOUNT`](https://docs.microsoft.com/en-us/sql/t-sql/functions/rowcount-transact-sql) function. After each `UPDATE`, you'd
- SET @rows = @rows + @@ROWCOUNT;
MySQL has the `FOUND_ROWS()` function
- This is possible in SQL Server using the built-in [`@@ROWCOUNT`](https://docs.microsoft.com/en-us/sql/t-sql/functions/rowcount-transact-sql) function. After each `UPDATE`, you'd
- SET @rows = @rows + @@ROWCOUNT;
- MySQL has the [`FOUND_ROWS()`](https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_found-rows) function, but it only works on `SELECT`s.