Blame | Last modification | View Log | Download
you need to configure 'remote proc trans' to "1" in server parameters.Ex:exec sp_configure 'remote proc trans','1' reconfigure with overrideThis will permmit you to execute any distributed queriesSET XACT_ABORT ON;BEGIN TRYBEGIN TRANSACTIONBEGIN TRY-- Error is on this lineINSERT INTO linkedsrv1.db1.[dbo].tbl1 ([IdWebsite], [IdProductType])VALUES (1200, 0)END TRYBEGIN CATCHSELECT 'Insert Error', ERROR_NUMBER(), ERROR_MESSAGE(), ERROR_SEVERITY(), ERROR_STATE()RAISERROR (15600,-1,-1, 'INSERT ERROR');END CATCHCOMMIT TRANSACTIONEND TRYBEGIN CATCHSELECT 'Transaction Error', ERROR_NUMBER(), ERROR_MESSAGE(), ERROR_SEVERITY(), ERROR_STATE()IF XACT_STATE() != 0ROLLBACK TRANSACTIONEND CATCH