Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 transaction question

Author  Topic 

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2003-09-20 : 06:33:30
hi,
I have a scenario:
there is a transaction which updates records in multiple tables which are residing in multiple databases server,
how can I get the confirmation that the update is done on each database .

regards,
harshal.

The Judgement of the Judge is as good as the Judge.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-09-20 : 08:03:31
After each UPDATE statement, check @@ERROR and @@ROWCOUNT. If @@ERROR is non-zero, an error occurred, and if @@ROWCOUNT equals zero, no rows were updated.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2003-09-20 : 18:10:32
You can't check these directly though as checking one will lose the other

declare @error int, @rowcount int
update ....
select @error = @@error, @rowcount = @@rowcount
if @error <> 0 or @rowcount <> 0
begin
...
end



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -