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 user defined datatypes and when you should go for them? : Sql server database administration
How to get a list of columns in a view using the "sp_help" stored procedure?
Explain steps of normalization?
How to delete an existing row with delete statements in ms sql server?
What should be the fill factor for indexes created on tables? : sql server database administration
What is the difference between varchar and nvarchar datatypes?
What are the methods used to protect against sql injection attack?
What are date and time data types in ms sql server?
Can we use having clause without group by?
How to list all columns in a table using odbc_columns()?
How to edit table in sql server 2017?
What keyword you will use to get schema appended to the result set of a ‘for xml’ query?
What are unicode character string data types in ms sql server?
How to reaname table name without using sp_Rename in sql server..?
what is denormalization? : Sql server database administration