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 key constraints?
How dts is used to extract, transform and consolidate data?
Can group functions be used in the order by clause in ms sql server?
What is similarity and difference between truncate and delete in sql?
What are acid properties of transaction?
what is a schema in sql server 2005? Explain how to create a new schema in a database? : Sql server database administration
What new data source types were added in ssrs 2014?
How to how to convert numeric expression data types using the convert() function??
What is a sql join?
What is dirty page?
What the different components in replication and what is their use?
What is the difference between system objects and user objects?
Does sql server 2016 have ssms?
can we have a nested transaction? : Sql server database administration
What is the return type of executeupdate ()?