How can you get @@error and @@rowcount at the same time?
Answer Posted / pankaj
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 ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is bit data type? What's the information that can be stored inside a bit column?
What is sub-query in sql server?
How to test values returned by a subquery with the in operator?
List types of tables in SQL Azure?
What is a cache in ssrs?
Can we perform backup restore operation on tempdb? : sql server database administration
What is provisioning, billing and metering, and connection routing concepts in the service layer?
How to use clusters?
What are null values in ms sql server?
What is the purpose of sql profiler in sql server?
What are the elements of dbms?
what is the sql equivaent of the dataset relation object ?
explain what is raid and what are different types of raid configurations? : Sql server database administration
What is inner join? Explain with an example?
How to create a dynamic cursor with the dynamic option?