Answer: @@rowcount gives the number of rows given as a result of previous query ran.
Example:
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
Asked In: Many Interviews |
Alert Moderator