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 happens on checkpoint? : Sql server database administration
Explain what stored procedure sp_replcounters is used for? : sql server replication
what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration
Explain the steps to use transact-sql cursor?
When we should use and scope of @@identity?
What are the two modes of authentication in sql server?
Can sql servers linked to other servers like oracle?
This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?
What are the purpose of Normalisation?
What is an indexed view?
What are the two authentication modes in sql server?
Why Master database is required?
Is it true, that there is no difference between a rule and a check constraint?
How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?
What is create command?