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

What is the process of normalization?

761


What is the partitioning method?

746


What are SSL and TSL protocols?

747


What is the difference between executequery () and executeupdate ()?

711


Difference between 2NF &3NF ?

843






Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you

1477


Why we use functions in sql server?

719


What is the difference between dbcc indexdefrag and dbcc reindex?

708


What are different types of raid levels?

747


1)what is the difference between Reinitializing a Subscription and synchronization the subscription? 2)when to use reinitializing ? 3)when to use synchronization? 4)when adding table or deleting a table what to do?(reinz.. or syn) 5)when adding a column what to do?

1726


Explain view in sql server?

820


How many types of the database links?

791


You have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation?

678


What is nonclustered index with included columns ?

712


What are the types of processing and explain each? : sql server analysis services, ssas

903