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 database roles? : sql server security
How to find index size for each index on table?
How to get a list of columns in a view using the "sp_help" stored procedure?
What is a linked server in sql server?
Give main differences between "Truncate" and "Delete".
What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas
How do I clean up sql server transaction log?
What is the log shipping?
How to transfer data from a cursor to variables with a "fetch" statement?
how to restart sql server in single user mode? How to start sql server in minimal configuration mode? : Sql server database administration
How to connect ms access to sql servers through odbc?
How is SQL Azure different than SQL server?
How to loop through the result set with @@fetch_status?
Explain important index characteristics?
What are the differences between clustered and non-clustered index?