Hi...
CREATE PROCEDURE dbo.UpdCategory
AS
BEGIN
BEGIN TRY
BEGIN TRANSACTION tnUpdCategory
UPDATE Con
SET Category1code =c1.Category1Name, Category2Code=c2.Category2Name
FROM Contacts Con
INNER JOIN Category1 As c1
ON Con.Category1Code = c1.Category1Code
Inner Join Category2 As c2
ON Con.Category2Code = c2.Category2Code;
COMMIT TRANSACTION tnUpdCategory
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION tnUpdCategory
PRINT ERROR_MESSAGE()
END CATCH
END