How can we help you today? How can we help you today?
JayR

Activity overview

Latest activity by JayR

Here is a copy of the script that was generated.  The column we added is called 'ARCo' .  Basically that entire chunk the the script should have an "if exists..." check so that it can be skipped if the column is already there. Possibly RedGate isn't putting in the appropriate "if exists..." because of various combination of not null/indexes/primary keys on the table.  Script created by SQL Compare Engine version 12.4.10.4968 from Red Gate Software Ltd at 5/24/2019 10:36:02 PM */ SET NUMERIC_ROUNDABORT OFF GO SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON GO PRINT N'Dropping constraints from [dbo].[vARStatementDelivery]' GO IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PK_vARStatementDelivery]', 'PK') AND parent_object_id = OBJECT_ID(N'[dbo].[vARStatementDelivery]', 'U')) ALTER TABLE [dbo].[vARStatementDelivery] DROP CONSTRAINT [PK_vARStatementDelivery] GO PRINT N'Dropping index [IX_vARStatementDelivery_CustGroup_Customer] from [dbo].[vARStatementDelivery]' GO IF EXISTS (SELECT 1 FROM sys.indexes WHERE name = N'IX_vARStatementDelivery_CustGroup_Customer' AND object_id = OBJECT_ID(N'[dbo].[vARStatementDelivery]')) DROP INDEX [IX_vARStatementDelivery_CustGroup_Customer] ON [dbo].[vARStatementDelivery] GO PRINT N'Rebuilding [dbo].[vARStatementDelivery]' GO CREATE TABLE [dbo].[RG_Recovery_1_vARStatementDelivery] ( [ARStatementDeliveryID] [int] NOT NULL IDENTITY(1, 1), [CustGroup] [dbo].[bGroup] NOT NULL, [Customer] [dbo].[bCustomer] NOT NULL, [Recipient] [varchar] (60) COLLATE Latin1_General_BIN NULL, [Email] [varchar] (60) COLLATE Latin1_General_BIN NULL, [Address1] [varchar] (60) COLLATE Latin1_General_BIN NULL, [Address2] [varchar] (60) COLLATE Latin1_General_BIN NULL, [City] [varchar] (30) COLLATE Latin1_General_BIN NULL, [State] [char] (4) COLLATE Latin1_General_BIN NULL, [Country] [char] (2) COLLATE Latin1_General_BIN NULL, [PostalCode] [dbo].[bZip] NULL, [DateSent] [dbo].[bDate] NULL, [DeliveryMethod] [char] (1) COLLATE Latin1_General_BIN NOT NULL, [DeliveryStatus] [char] (1) COLLATE Latin1_General_BIN NOT NULL, [UniqueAttchID] [uniqueidentifier] NULL, [ARCo] [dbo].[bCompany] NOT NULL ) ON [PRIMARY] GO SET IDENTITY_INSERT [dbo].[RG_Recovery_1_vARStatementDelivery] ON GO INSERT INTO [dbo].[RG_Recovery_1_vARStatementDelivery]([ARStatementDeliveryID], [CustGroup], [Customer], [Recipient], [Email], [Address1], [Address2], [City], [State], [Country], [PostalCode], [DateSent], [DeliveryMethod], [DeliveryStatus], [UniqueAttchID]) SELECT [ARStatementDeliveryID], [CustGroup], [Customer], [Recipient], [Email], [Address1], [Address2], [City], [State], [Country], [PostalCode], [DateSent], [DeliveryMethod], [DeliveryStatus], [UniqueAttchID] FROM [dbo].[vARStatementDelivery] .... ... ... ... .. ... ... ... / comments
Here is a copy of the script that was generated.  The column we added is called 'ARCo' .  Basically that entire chunk the the script should have an "if exists..." check so that it can be skipped if...
0 votes
In SQL Compare can generated scripts do 'IF EXISTS....' check before adding columns?
We are having SQL Compare generate scripts to upgrade databases. We have a fairly complicated scenario where we need to add a new not null column to a table in pre-scripts and populate the new colu...
2 followers 9 comments 0 votes