Column rename

Brian DonahueBrian Donahue Posts: 6,590 New member
edited November 25, 2005 9:51AM in SQL Compare Previous Versions
Hi Michael,

As far as I know, there is no way to practically manage a column rename.
SQL Compare will always treat the renamed column as a new column in one
database and a missing column in the other.

Yours,

Brian Donahue
Red Gate Technical Support

"Michael Tissington" <[email protected]> wrote in message
news:[email protected]
> The only difference between two tables is a column name.
>
> So that I keep all the data, how do I make a 'rename' of a column occur ?
>
> --
> Michael Tissington
> http://www.oaklodge.com
> http://www.tabtag.com
>
>

Comments

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

    SQL Toolkit doesn't have 'native' support for renaming columns. All I
    can think of would be some routine to go through the SQL migration script's
    batches of SQL and modifying the output manually to keep the column from
    being dropped.

    It would not be easy!

    Regards,

    Brian Donahue
    Red Gate Technical Support

    "Vlad" <[email protected]> wrote in message
    news:yai8Qa%[email protected]
    > Hi Brian,
    >
    > That is too bad! You could manage it my specifying in a dropdown list
    which
    > columns are to be treated as being renamed- kind of similar to
    DataCompare's
    > column selection to be included in the compare.
    >
    > That and the non-null column addition is the only thing that is still a
    > problem for me. Does SqlToolkit allow one to designate a column as
    renamed
    > and add a non-null column to a table that already has some records?
    >
    > Thanks!
    >
    > "Brian Donahue (Red Gate)" <[email protected]> wrote in message
    > news:[email protected]
    > > Hi Michael,
    > >
    > > As far as I know, there is no way to practically manage a column
    > rename.
    > > SQL Compare will always treat the renamed column as a new column in one
    > > database and a missing column in the other.
    > >
    > > Yours,
    > >
    > > Brian Donahue
    > > Red Gate Technical Support
    > >
    > > "Michael Tissington" <[email protected]> wrote in message
    > > news:[email protected]
    > > > The only difference between two tables is a column name.
    > > >
    > > > So that I keep all the data, how do I make a 'rename' of a column
    occur
    > ?
    > > >
    > > > --
    > > > Michael Tissington
    > > > http://www.oaklodge.com
    > > > http://www.tabtag.com
    > > >
    > > >
    > >
    > >
    >
    >
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    SQL Compare now -tries- to preserve renamed column data by copying the data from one column to another if there is one missing and one additional column and they both have -similar- names. There is still a chance for data loss, but this is minimized quite a bit now.
This discussion has been closed.