I am inserting a number or rows into a table using INSERT with SELECT. After the transaction, I want to store both the @@ROWCOUNT and @@ERROR values into locallay declared variables.
INSERT SubscriberList (PublicationId, SubscriberId)
SELECT @PublicationId, S.SubscriberId
FROM Subscribers S
SET @NoRows = @@ROWCOUNT
SET @ErrorCode = @@ERROR
I wasn't sure if this was valid in as much if I call one, will I negate the other?