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
What are the pros and cons of putting a scalar function in a queries select list or in the where clause?
What is subquery? Explain the properties of a subquery?
explain different types of backups avaialabe in sql server? : Sql server database administration
How to see the event list of an existing trigger using sys.trigger_events?
What is difference between materialized view and view?
What does sql server mean?
How to check parameter value in stored procedure sql server?
Can we deploy SSRS reports on our personal website?
How many files can a database contain in sql server?how many types of data files exists in sql server? How many of those files can exist for a single database?
What are sql server functions?
Explain about integration services of Microsoft SQL server?
We need to perform what steps in the following order to work with a cursor?
Explain the functionalities that views support?
What does null mean?
What are “unrepeatable reads”?