Is it possible to merge two tables to one?

gilorlevgilorlev Posts: 2
edited July 25, 2016 6:26AM in SQL Compare 11
Hello.

I have two databases, both contain a table called ERPPart_Custom (there are more such duplicates.)
The table on DB 1 has the following columns:

[ERPPartID] [int] NOT NULL,
[PartNumber] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL,
[Description] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL,
[IsRetired] [tinyint] NULL,
[PartTypeCode] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL,
[SpecificWeight] [float] NULL,
[BatchManaged] [int] NULL,
[InterchangabilityGroup] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL,
[Group] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL

The table on DB 2 has the following columns:

[ERPPartID] [int] NOT NULL,
[PartNumber] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL,
[Description] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL,
[IsRetired] [int] NULL,
[StandardLength] [float] NULL,
[IsBW] [int] NULL

When I do a compare and deploy, the result table looks like the first - meaning the columns of the table from DB 2 are gone.

Is it possible to make SQL compare create a script which merges these tables so that the result would be a table with the following columns:

[ERPPartID] [int] NOT NULL,
[PartNumber] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL,
[Description] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL,
[IsRetired] [tinyint] NULL,
[PartTypeCode] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL,
[SpecificWeight] [float] NULL,
[BatchManaged] [int] NULL,
[InterchangabilityGroup] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL,
[Group] [nvarchar] (254) COLLATE Latin1_General_CI_AS NULL
[StandardLength] [float] NULL,
[IsBW] [int] NULL


?

Thank you!

Comments

Sign In or Register to comment.