How can you get @@error and @@rowcount at the same time?

Answer Posted / yjreddy

select @@ROWCOUNT
it will give the no of rows affected by last sql statement
select @@ERROR
it will display the error number for last sql statement

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between upgrade and migration in sql server?

587


Where sql server user names and passwords are stored in sql server? : sql server database administration

575


Tell me what is log shipping?

567


Explain what is log shipping?

574


What is the main difference between ‘between’ and ‘in’ condition operators?

583






What is merge statement?

623


Explain foreign key in sql server?

575


What does the on update no action do?

587


How to Update from select query in sql server?

542


How to check table values in sql server?

530


What is the purpose of linked server configuration in sql server?

552


Does a full backup include transaction log?

479


How would you use user_constraints table in DB?

586


To which devices can a backup be created and where should these devices be located? : sql server management studio

565


Can we use custom code in ssrs?

581