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 are the key events of sqlconnection class?

720


What is sql connection in ado.net?

587


Which object needs to be closed?

1859


What are typed and untyped dataset?

639


List all the steps in order, to access a database through ado.net?

674






What is the advantage of ado.net?

641


Does sqlclient and oledb class share the same functionality?

616


What is sqldatareader?

572


What is disconnected architecture in ado.net?

586


Which namespaces are used for data access?

717


How to pass values into a datatable?

690


Which provider is used to connect ms access, oracle, etc…?

609


Can you explain how to enable and disable connection pooling?

584


What is ado control?

609


How do you update database through dataset?

621