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

Answer Posted / sachin rakshe

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

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens when transaction log is full?

515


What do you mean by recursive stored procedure?

513


What is reportserver and reportservertempdb ?

107


What is difference between join and natural join?

481


What is bit data type?

630






What is unpivot?

574


How to read data in a table with "select" statements?

563


Do you know the different ddl commands in sql?

593


Hi all, can any one please tell me the difference between sql server 2008 and orace 9i

1530


Explain can you implement data mining in ssrs?

106


What is the difference between a unique key and primary key?

515


Different types of keys in SQL?

635


can you instantiate a com object by using t-sql? : Sql server database administration

523


What is difference between equi join and natural join?

543


What is database isolation in sql server? : sql server database administration

570