Hi,
I seem unable to get a distributed transaction to work, it keeps erroring with...
Here is the T-SQL
I have set up MSDTC, I have successfully ran both DTCPing & DTCTester on both SQL boxes, the firewall rules are in place, linked servers are set up and I can run ordinary queries and T-SQL against them, DTC services seem to be running fine, everything looks as though it should be good to go.
I guess there is something wrong with my transaction?
Your help is appreciated.
Regards,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
I seem unable to get a distributed transaction to work, it keeps erroring with...
OLE DB provider "SQLNCLI10" for linked server "Members" returned message "No transaction is active.".
Here is the T-SQL
Code:
ALTER PROCEDURE [dbo].[spCC_UpdateRAG]
-- Add the parameters for the stored procedure here
@Col varchar(10),
@RAG tinyint,
@Case_ID int,
@Officer varchar(50),
@ACC varchar(3)
AS
BEGIN TRY
-- start transaction
BEGIN TRANSACTION
-- update tables
-- Audit
UPDATE Compliance_Audit SET @Col = @RAG WHERE Case_ID = @Case_ID
-- Checker
UPDATE [Members].[Members_Live].[dbo].Case_Checking SET @Col = @RAG WHERE Case_ID = @Case_ID
-- NBCS
UPDATE [Members].[Members_Live].[dbo].Business_Register SET Check_Flag = @RAG WHERE Rec_ID = @Case_ID
-- Insert History
INSERT INTO Case_Checker_Grades (Case_ID,Grade,Officer,ACC) VALUES (@Case_ID,@RAG,@Officer,@ACC)
-- got this far commit
COMMIT TRANSACTION
-- return success (true)
RETURN -1
END TRY
BEGIN CATCH
-- roll back transaction
ROLLBACK TRANSACTION
-- return failure (false)
RETURN 0
END CATCH
I have set up MSDTC, I have successfully ran both DTCPing & DTCTester on both SQL boxes, the firewall rules are in place, linked servers are set up and I can run ordinary queries and T-SQL against them, DTC services seem to be running fine, everything looks as though it should be good to go.
I guess there is something wrong with my transaction?
Your help is appreciated.
Regards,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music