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

Answer Posted / guest

@@rowcount gives the number of rows given as an result of
previous query ran.

Create procedure get_emp_count ( @emp_id int)
As
Select * from emp where emp_id =@emp_id

If @@rowcount = 0
Begin
Select 'no rows with emp_id= '
Select @emp_id
End

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different execute methods of Ado.Net?

553


How do you implement locking concept for dataset?

541


What is ado.net explain with diagram?

513


What are all the different methods under sqlcommand?

518


What are ado.net objects?

531






How is entity framework different from ado.net?

485


Explain how to pass multiple tables in datasets simultaneously?

495


What do you mean by ‘batch updates’?

513


What is dbcontext and dbset in entity framework?

484


Which method in OLEDBAdapter is used to populate dataset with records?

561


Explain ODP.net

570


Which database is the ado.net?

498


What is ado recordset?

498


What is the procedure to call a Stored Procedure of Back End in ADO (ActiveX Data Object) and RDO (Remote Data Objects)?

557


What are the important features of ado.net 2.0?

592