use pubs

set xact_abort on

BEGIN DISTRIBUTED TRANSACTION
BEGIN TRY
INSERT INTO PLUTO5.pubs..jobs values('asdfasd', 2, 30)
COMMIT TRANSACTION
END TRY
BEGIN CATCH
Print error_number()
ROLLBACK TRANSACTION
END CATCH



select * from jobs


BEGIN DISTRIBUTED TRANSACTION
BEGIN TRY
--INSERT INTO LinkSQLSrvr3.pubs.dbo.jobs (job_desc, min_lvl, max_lvl) 
--values('asdfasd', 10, 30)
SELECT au_lname from LinkSQLSrvr3.pubs.dbo.authors
END TRY
BEGIN CATCH
print error_number()
print error_message()
ROLLBACK TRANSACTION
END CATCH


select @@trancount

COMMIT TRANSACTION

sp_addlinkedserver N'LinkSQLSrvr2', ' ', N'SQLNCLI', N'192.168.2.100'


sp_addlinkedserver N'LinkSQLSrvr3', ' ', N'SQLNCLI', N'CANOPUS5'
