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
Would you store your query in a ssrs report or a database server? State the reason why?
Which data types generate inaccurate results if used with an = or <> comparison in a where clause of a sql statement?
what purpose does the model database serve? : Sql server database administration
Explain transaction server distributed transaction?
How optimize sql query with multiple joins in sql server?
What is read uncmmited?
Which autogrowth database setting is good?
List out some of the requirements to set up a sql server failover cluster?
What is database black box testing?
explain declarative management framework (dmf) in sql server 2008?
Explain the steps to create and execute a user-defined function in the sql server?
Do you know what is a trace frag? Where do we use it?
What are the recovery models for a database?
What will happen if a column containing char type data is changed to the nchar data type?
How is sql used in sql server?