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 ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between executenonquery and executequery?

468


How can we load multiple tables in a dataset?

533


Command objects uses, purposes and their methods.

519


What are the objects of ado.net?

527


How to pass multiple tables in datasets simultaneously?

569






Why do we use sqldataadapter?

479


What is shadow copy?

576


What are the different ado.net namespaces are available in .net?

495


Which method is used to sort the data in ADO.Net?

1505


Which is better entity framework or ado.net?

509


What is meant by executenonquery?

527


What is command class in ado.net?

473


What is the difference between oledb sql server and oledbdotnet provider?

500


Does sqlclient and oledb class share the same functionality?

534


Which architecture does Datasets follow?

586