DataCompare problem

Brian DonahueBrian Donahue Posts: 6,590 New member
Hi Daniel,

Thanks for your post. CreateFrom Intersection behaves exactly like the
UI version of SQL Data Compare in that it excludes tables that are
ineligible for a data comparison. You'll need to put a primary key on those
tables before they will be returned in the common tables collection.

Regards,

Brian Donahue
Red Gate Technical Support

"Daniel Modler" <[email protected]> wrote in message
news:[email protected]
> Hi,
>
> We are evaluating SQL Data Compare and it looks very vell; but we've got a
> problem with a single, very simple table (withouth primary key etc.). The
> table is being "swallowed" by CreateFromIntersection() although it's
exactly
> the same in both databases.
>
> Here is the code snippet ...
>
> provider = New RedGate.SQLDataCompare.Engine.SqlProvider
> db1 = provider.GetDatabase(New
> RedGate.SQLDataCompare.Engine.SqlConnectionProperties(.cboSQL1.Text,
> .txtDatenbank.Text, "sa", "xxxxx"))
>
> db2 = provider.GetDatabase(New
> RedGate.SQLDataCompare.Engine.SqlConnectionProperties(.cboSQL2.Text,
> "DATABASE1", "sa", "xxxxx"))
>
> commonTables =
> RedGate.SQLDataCompare.Engine.Tables.CreateFromIntersection(db1.Tables,
> db2.Tables)
>
> settings = New RedGate.SQLDataCompare.Engine.TableComparisonSettings
>
>
> The table is listed inside db1.Tables() and db2.Tables() with identical
> fields, but not visible inside commonTables()!
>
> Here's the creation script from SQL server for DB #1:
> if exists (select * from dbo.sysobjects where id =
> object_id(N'[TodoZeitraeume]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
> drop table [TodoZeitraeume]
> GO
>
> CREATE TABLE [TodoZeitraeume] (
> [days] [int] NOT NULL ,
> [descr] [varchar] (50) COLLATE Latin1_General_CI_AS NOT NULL
> ) ON [PRIMARY]
> GO
>
>
>
> DB #2:
> if exists (select * from dbo.sysobjects where id =
> object_id(N'[TodoZeitraeume]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
> drop table [TodoZeitraeume]
> GO
>
> CREATE TABLE [TodoZeitraeume] (
> [days] [int] NOT NULL ,
> [descr] [varchar] (50) COLLATE Latin1_General_CI_AS NOT NULL
> ) ON [PRIMARY]
> GO
>
>
> Any ideas on what could be wrong?
>
> Regards & Thanks in Advance
>
>

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi Daniel,

    Thanks for your post. CreateFrom Intersection behaves exactly like the
    UI version of SQL Data Compare in that it excludes tables that are
    ineligible for a data comparison. You'll need to put a primary key on those
    tables before they will be returned in the common tables collection.

    Regards,

    Brian Donahue
    Red Gate Technical Support

    "Daniel Modler" <[email protected]> wrote in message
    news:[email protected]
    > Hi,
    >
    > We are evaluating SQL Data Compare and it looks very vell; but we've got a
    > problem with a single, very simple table (withouth primary key etc.). The
    > table is being "swallowed" by CreateFromIntersection() although it's
    exactly
    > the same in both databases.
    >
    > Here is the code snippet ...
    >
    > provider = New RedGate.SQLDataCompare.Engine.SqlProvider
    > db1 = provider.GetDatabase(New
    > RedGate.SQLDataCompare.Engine.SqlConnectionProperties(.cboSQL1.Text,
    > .txtDatenbank.Text, "sa", "xxxxx"))
    >
    > db2 = provider.GetDatabase(New
    > RedGate.SQLDataCompare.Engine.SqlConnectionProperties(.cboSQL2.Text,
    > "DATABASE1", "sa", "xxxxx"))
    >
    > commonTables =
    > RedGate.SQLDataCompare.Engine.Tables.CreateFromIntersection(db1.Tables,
    > db2.Tables)
    >
    > settings = New RedGate.SQLDataCompare.Engine.TableComparisonSettings
    >
    >
    > The table is listed inside db1.Tables() and db2.Tables() with identical
    > fields, but not visible inside commonTables()!
    >
    > Here's the creation script from SQL server for DB #1:
    > if exists (select * from dbo.sysobjects where id =
    > object_id(N'[TodoZeitraeume]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    > drop table [TodoZeitraeume]
    > GO
    >
    > CREATE TABLE [TodoZeitraeume] (
    > [days] [int] NOT NULL ,
    > [descr] [varchar] (50) COLLATE Latin1_General_CI_AS NOT NULL
    > ) ON [PRIMARY]
    > GO
    >
    >
    >
    > DB #2:
    > if exists (select * from dbo.sysobjects where id =
    > object_id(N'[TodoZeitraeume]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    > drop table [TodoZeitraeume]
    > GO
    >
    > CREATE TABLE [TodoZeitraeume] (
    > [days] [int] NOT NULL ,
    > [descr] [varchar] (50) COLLATE Latin1_General_CI_AS NOT NULL
    > ) ON [PRIMARY]
    > GO
    >
    >
    > Any ideas on what could be wrong?
    >
    > Regards & Thanks in Advance
    >
    >
This discussion has been closed.