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

Explain how to copy the contents from one table to another table and how to delete the source table in ado.net?

456


What is the hierarchy of data in databases?

500


In how many ways we can retrieve table records count? How to find the count of records in a dataset?

544


What is the difference between Datareader and Dataset?

541


Explain advantages of ado.net?

558






What is the difference between executequery and executenonquery?

508


What are the different row versions available in table?

529


Define the data provider classes that is supported by ado.net?

517


What is fill method in ado.net?

543


How to copy the contents from one table to another table and how to delete the source table in ado.net?

523


What is ado net stands for?

516


Which is faster sqldataadapter and sqldatareader?

498


Explain the role of data provider in ado.net? What is the role of data provider in ado.net?

528


What is different between sqlcommand object and command behavior object?

539


What is Dataset Object?

561