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
Can we use having clause without group by?
What is the difference between resultset and resultsetmetadata?
What is the maximum number of index per table?
Define left outer join in sql server joins?
what are questions asked in TCS for database tester (sqlserver)for 2-3 exp?
How can we improve performance by using SQL Server profiler?
How do I repair damaged sql server mdf file database? In previous day my mdf file has got damage due to unknown reasons then I used dbcc chekcdb command but it failed, MDF file is important for me, I don’ know that how to get back mdf file data. Please anyone suggest me?
Describe in brief system database.
What is the difference between push and pull subscription? : sql server replication
how many clustered indexes can be created on a table? : Sql server database administration
What are the five characteristics of good data?
How to use “drop” keyword in sql server and give an example?
What are logical database components? : SQL Server Architecture
how do you implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql server database administration
How does clustered and non clustered index work?