How can you get @@error and @@rowcount at the same time?

Answer Posted / laxman

SELECT @RC = @@ROWCOUNT
SELECT @ER = @@ERROR
if we use above statements then @@error will be reset with
0.
i think right one is

select @er=@@error,@rc=@@rowcount

Is This Answer Correct ?    31 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What functions can a view be used to performed?

626


How to copy data from one table to another table?

546


How to send a ssrs report from ssis?

125


What do you mean by acid?

578


What are the types of resultset?

535






Retrieve the unique rows from table without using UNIQUE and DISTINCT keywords.

593


Detail about the hardware which is supported by SQL server?

591


Define a cross join?

598


How to create a simple user defined function in ms sql server?

547


Explain transaction server distributed transaction?

503


What is cursor in ms sql server?

566


What are dml (data manipulation language) statements in ms sql server?

556


What is a result set object returned by mssql_query()?

580


What is user-defined inline table-valued function?

518


What is SQL Azure Fabric?

92