USE [task]
GO
/* ===================================================== ================================
Server: test
DataBase: task
Author: aaa
SPName: UP_UPdateData
Version: 1.0
Date: 2009-11-15
Content: UP_UPdateData
* Parameters
*--------------------------------------------------------
* Input:
*
* Output: N/
*
*
* Table Used:
*---------------------------------------------------------
* Dbo. tblTask
-----------------------------------------------------------
Modified history:
Date Modified by VER Description
------------------------------------------------------------
2009/11/15 XXX 1.00
========================================================== ============================= */
Create procedure dbo. UP_UPdateData
(
@ TaskID INT
)
AS
BEGIN
SET NOCOUNT ON
SET XACT_ABORT ON -- need to use distributed transactions (connect to the server)
BEGIN TRY
BEGIN TRANSACTION
-- Update table data on the linked server (dbserver. dbname. dbo. Tablename)
IF (@ RowCount> 0)
BEGIN
-- Insert local data
END
COMMIT TRANSACTION
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
END CATCH
END
GO