What is @@rowcount and with small code snippet explain the
usage?

Answer Posted / jagan

@@ROWCOUNT:

Returns the number of rows affected by the last statement.


ex:

UPDATE authors SET au_lname = 'Jones'
WHERE au_id = '999-888-7777'
IF @@ROWCOUNT = 0
print 'Warning: No rows were updated'

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ado.net connection?

468


What is adodb dll?

518


Explain all the classes those are used for database connections between sql server and asp.net?

507


What are the data access namespaces in .NET?

630


What is sql command in ado net?

503






What is the use of SqlCommandBuilder?

620


What is datatable in ado.net?

521


What is the difference between ado.net and entity framework?

508


How can we load multiple tables in to dataset?

571


Explain the difference in an abstract class and an interface?

504


How can I retrieve two tables of data at a time by using data reader? Data reader read and forward only, how is it possible to get 2 tables of data at a time?

520


Define table relations?

557


What is difference between ado and other data object?

470


Why is ADO.NET serialization slower than ADO ?

567


What are the advantages and drawbacks of using ado.net?

622