Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Script created by SQL Data Examiner 7.1.8.338 at 12-05-2023 16:35:42.
- Run this script on [192.168.0.4,1983].PRITPB to make it the same as PRIMAVERAV10.PRITPB
- */
- BEGIN TRANSACTION
- BEGIN TRY
- --Updating [dbo].[TDU_UnidadeNegocio] (5 records)
- UPDATE [dbo].[TDU_UnidadeNegocio] SET [CDU_CC] = 1 WHERE [CDU_Codigo] = N'CC'
- UPDATE [dbo].[TDU_UnidadeNegocio] SET [CDU_CC] = 1 WHERE [CDU_Codigo] = N'CS'
- UPDATE [dbo].[TDU_UnidadeNegocio] SET [CDU_PV] = 1, [CDU_CC] = 1 WHERE [CDU_Codigo] = N'EQ'
- UPDATE [dbo].[TDU_UnidadeNegocio] SET [CDU_PV] = 1, [CDU_CC] = 1 WHERE [CDU_Codigo] = N'ES'
- UPDATE [dbo].[TDU_UnidadeNegocio] SET [CDU_PV] = 1 WHERE [CDU_Codigo] = N'PV'
- --End of transaction
- PRINT 'Commit synchronization.'
- COMMIT TRANSACTION
- END TRY
- BEGIN CATCH
- --If during synchronization process an error occurred then the following code will be executed
- IF @@error <> 0 AND @@trancount > 0
- BEGIN
- DECLARE @EX_ERROR_MESSAGE nvarchar(MAX), @STATE INT, @SEVERITY INT
- SELECT @EX_ERROR_MESSAGE =
- 'An error occurred:' + CHAR(13) + CHAR(10)
- + 'Msg ' + CAST( ERROR_NUMBER() AS nvarchar(20) )
- + ', Level ' + CAST( ERROR_SEVERITY() AS nvarchar(20) )
- + ', State ' + CAST( ERROR_STATE() AS nvarchar(20) )
- + ', Line ' + CAST( ERROR_LINE() AS nvarchar(20) ) + CHAR(13) + CHAR(10)
- + ERROR_MESSAGE() + CHAR(13) + CHAR(10),
- @SEVERITY = ERROR_SEVERITY(),
- @STATE = ERROR_STATE()
- RAISERROR(@EX_ERROR_MESSAGE, @SEVERITY, @STATE)
- END
- ROLLBACK TRAN
- PRINT 'Data synchronization is completed with errors, all changes were cancelled'
- END CATCH
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement