Search:     Advanced search
Browse by category:
C/C++   |   Java   |   Oracle/Database   |   SAP   |   ASP .NET   |   Mainframe-DB2   |   Freshers

How to get @@ERROR and @@ROWCOUNT at the same time?

Add comment
Views: 117
Votes: 0
Comments: 0
If @@Rowcount is checked after Error checking statement then it will have 0 as the value of @@Recordcount as it would have been reset. And if @@Recordcount is checked before the error-checking statement then @@Error would get reset. To get @@error and @@rowcount at the same time do both in same statement and store them in local variable. SELECT @RC = @@ROWCOUNT, @ER = @@ERROR
Others in this Category
document What is the difference between a Local and a Global temporary table?
document List few advantages of Stored Procedure.
document What command do we use to rename a db, a table and a column?
document How to copy the tables, schema and views from one SQL Server to another?
document What is User Defined Functions? What kind of User-Defined Functions can be created?
document What is Row_Number()?
document What is Log Shipping?
document What’s the difference between a primary key and a unique key?
document What is Cursor?
document What is the difference between UNION and UNION ALL?
» More articles



RSS