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

Answer Posted / ramakrishna

DECLARE @RC int
DECLARE @ER int

INSERT INTO T(Cal1,Col2..)
SELECT ColX,ColY..
FROM T1

SELECT @RC = @@ROWCOUNT
SELECT @ER = @@ERROR

Is This Answer Correct ?    3 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a simple stored procedure in ms sql server?

523


Difference between Inner vs outer joins?

535


What is data compression?

548


Explain index in sql server?

598


Explain how you can deploy an SSRS report?

106






what is database replicaion? What are the different types of replication you can set up in sql server? : Sql server database administration

533


What is the language structure to add a record to a table?

581


How to get the definition of a view out of the sql server?

509


Do you know how to send email from database?

556


Explain go command in sql server?

547


Explain temporary table vs table variable by using cursor alternative?

528


What are “unrepeatable reads”?

744


What is sql or structured query language?

687


What are the types of user defined functions in sql server?

504


Name three of the features managed by the surface area configuration tool? : sql server security

514