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

Explain the various objects in dataset.

600


What is ole data type?

592


What is the difference between Datareader and Dataset?

619


Which one of the objects is a high-level abstraction of the connection and command objects in ado.net?

736


Why do we need ado.net?

635






How we can provide data to ado.net?

627


What is the difference between Dataset. clone and Dataset.copy?

640


What are the main differences between classic ado and ado.net?

613


What is the difference between sqlcommand and sqldataadapter?

580


What is variable view?

576


What is the difference between OLEDB Provider and SqlClient?

612


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

598


What is csdl entity framework?

626


How to bind the controls(best practice) comboboxes to the data in the dataset?

621


What is difference between datatable and dataset?

599