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
tell me the disaster recovery plan
Can a synonym name of a table be used instead of a table name in a select statement?
What is the fillfactor concept in indexes?
Why main is user defined function?
What are distributed partitioned views?
What is ms sql server triggers?
What is the native system stored procedure to execute a command against all databases?
what is nonclustered index
what is a default tcp/ip socket assigned for sql server? : Sql server database administration
Does the unique constraint create an index?
what are statistics, under what circumstances they go out of date, how do you update them? : Sql server database administration
How to change the data type of an existing column with "alter table" statements in ms sql server?
What is 3nf normalization form?
How can you start sql server in different modes?
what is the information that can be stored inside a bit column? : Sql server database administration