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 transaction server consistency?

553


How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?

1579


Does the unique constraint create an index?

568


Why de-normalization required?

576


Will the writetext statement activate a trigger?

571






You want your report to display a hyperlink that will take users to your intranet. How do you configure such a hyperlink?

243


Tell me what is a linked server?

564


What is the difference between update lock and exclusive lock?

497


What is difference between unique and primary key?

479


What are the general features of sql server management studio? : sql server management studio

599


What are system databases in ms sql server?

539


What is “asynchronous” communication in sql server service broker?

547


Explain different backup plans?

533


Explain primary key and foreign key constraints?

527


Explain what is meant by replication of database?

535