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 2nf normalization?
What is policy based management (pbm)? : sql server database administration
Do you know how to implement service broker?
Can you tell me about the concept of ER diagrams?
What are 3 ways to get a count of the number of records in a table?
What is standby servers? Explain types of standby servers.
Explain try...catch with sql server?
Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?
What are parameterized reports?
What should be the fill factor for indexes created on tables? : sql server database administration
What is use of attribute hierarchy ordered ? : sql server analysis services, ssas
What are ddl (data definition language) statements for tables in ms sql server?
What is self join in sql server joins?
What is update_statistics command?
What stored by the msdb? : sql server database administration