Upgrading InBatch History Server from 8.1 SP1 to 2012 R2
file:///C|/inetpub/wwwroot/t002808/t002808.htm[11/27/2013 10:43:17 AM]
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
/****** Alter tables with Batch_Server_Name field ******/
/* Change made - added check for already exists otherwise script aborts here */
/* Change made - added 'go' after each table for smaller transactions */
IF COL_LENGTH('[AlarmComment]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[AlarmComment]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[AnalogAlarm]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[AnalogAlarm]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[AuditEvent]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[AuditEvent]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[BatchDetail]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[BatchDetail]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[BatchIdLog]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[BatchIdLog]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[BatchQuestion]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[BatchQuestion]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[BooleanAlarm]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[BooleanAlarm]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[DocViewEvent]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[DocViewEvent]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[EquipStatus]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[EquipStatus]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[Event]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[Event]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[MaterialChar]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[MaterialChar]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[MaterialInput]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[MaterialInput]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[MaterialInputChange]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[MaterialInputChange]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[MaterialOutput]','Batch_Server_Name') IS NULL
ALTER TABLE [dbo].[MaterialOutput]
ADD [Batch_Server_Name] [dbo].[BatchServer_Name] NOT NULL DEFAULT (N' ');
GO
IF COL_LENGTH('[NonBatchOperatorActions]','Batch_Server_Name') IS NULL