Rahul Chavan
What is the use of @@ROWCOUNT statement?
By Rahul Chavan in Databases & DBA on Apr 07 2016
  • Rahul Chavan
    Apr, 2016 7

    Using @@ROWCOUNT statement you can get the number of rows/ records affected by query execution. It is best practice that whenever you are doing update or delete on table data and if you know affected row count then you should validate that count against @@ROWCOUNT if it is not matching then transaction should be rolled back.

    • 3
  • Mukesh Sagar
    Nov, 2017 17

    To get the number of rows affected by the latest query that is executed. The @@ sign indicates that it is the system function.

    • 1
  • Guest User
    Sep, 2017 14

    The @@ROW COUNT variable returns the number of rows read by the last executed statement. If any statement does not return any rows, then value of @@ROWCOUNT variable is set to zero.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Awadhesh Jha
    Aug, 2017 14

    @@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.

    • 1
  • Venka Reddy
    Jun, 2017 7

    we find the how many rows in table

    • 1
  • Mr Eter
    Jun, 2019 13

    Only if the person who answered below had some way like @@rowcount to check how many times he is posting the same answer. Isn't it Ironic- he did the same mistake he wanted others to avoid. Posting just for fun, no hard feelings.'@@rowcount is sql function that returns how many rows affected by query execution. we can also use it when insert data into two tables in single procedures based on first table data insertion.'

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS