What are the challenges you face when working across database platforms? Take the survey
Options

Foreign Key Constraints not handled

Neil DavidsonNeil Davidson Posts: 281
edited July 17, 2003 2:43AM in SQL Compare Previous Versions
Toby,

Are you generating the scripts from the ! toolbar icon? Also, have you tried
selecting the table that the foreign key references to include that in the
script as well?

Yours,

Neil Davidson
"Toby Harman" <toby.harman@morningstar.com.au> wrote in message
news:rCPumucQDHA.1908@server53...
> Forgot to mention - Red-Gate SQL-Compare 2.03 - Trial Version!
>
> "Toby Harman" <toby.harman@morningstar.com.au> wrote in message
> news:qe9M53QQDHA.1156@server53...
> > Hi All
> >
> > First - Congrats to Red-Gate and the developers for developing a
seriously
> > useful tool.
> >
> > Now - I have a small problem!
> >
> > It would appear that the script (which I accept will only be 95%
> successful)
> > has a small problem.
> >
> > If there are two databases which contain the same table and a new column
> is
> > added to a table in one database it doesn't handle Foreign Keys very
well.
> > They don't appear to be dropped before the new table is created, and
thus
> > the old table cannot be dropped and the new table cannot be renamed into
> > place.
> >
> > Is this a known bug or am I doing something wrong?
> >
> > Thanks
> >
> > Toby
> >
> >
>
>
- Neil Davidson
Red Gate Software Ltd

Comments

  • Options
    Toby,

    It could well be sysdepends - it's notoriously unreliable. I'm not sure of
    any utilities to rebuild it - maybe try google groups?

    Is the foreign key error the first error that occurs when you run the
    scripts, or are there errors previous to that?

    - Neil


    "Toby Harman" <toby.harman@morningstar.com.au> wrote in message
    news:hkv3aA$SDHA.2424@server53...
    > Hi Neil
    >
    > Yes - The whole database is selected. and Yes, using the ! button to
    create
    > the script.
    >
    > The problem may be more in the area of the sysdepends table. I am not
    > convinced that this is adequately maintained. Are you aware of any
    utilities
    > to rebuild sysdepends?
    >
    > Also - The script will run if I partition it up I am not sure if the
    problem
    > is related to the script of a server setting on SQL which is not
    committing
    > the transactions as it should.
    >
    > Toby
    >
    > "Neil Davidson" <neil.davidson@red-gate.com> wrote in message
    > news:shj91UJRDHA.1456@server53...
    > > Toby,
    > >
    > > Are you generating the scripts from the ! toolbar icon? Also, have you
    > tried
    > > selecting the table that the foreign key references to include that in
    the
    > > script as well?
    > >
    > > Yours,
    > >
    > > Neil Davidson
    > > "Toby Harman" <toby.harman@morningstar.com.au> wrote in message
    > > news:rCPumucQDHA.1908@server53...
    > > > Forgot to mention - Red-Gate SQL-Compare 2.03 - Trial Version!
    > > >
    > > > "Toby Harman" <toby.harman@morningstar.com.au> wrote in message
    > > > news:qe9M53QQDHA.1156@server53...
    > > > > Hi All
    > > > >
    > > > > First - Congrats to Red-Gate and the developers for developing a
    > > seriously
    > > > > useful tool.
    > > > >
    > > > > Now - I have a small problem!
    > > > >
    > > > > It would appear that the script (which I accept will only be 95%
    > > > successful)
    > > > > has a small problem.
    > > > >
    > > > > If there are two databases which contain the same table and a new
    > column
    > > > is
    > > > > added to a table in one database it doesn't handle Foreign Keys very
    > > well.
    > > > > They don't appear to be dropped before the new table is created, and
    > > thus
    > > > > the old table cannot be dropped and the new table cannot be renamed
    > into
    > > > > place.
    > > > >
    > > > > Is this a known bug or am I doing something wrong?
    > > > >
    > > > > Thanks
    > > > >
    > > > > Toby
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >
    - Neil Davidson
    Red Gate Software Ltd
This discussion has been closed.