Altering columns used in a computed column

Brian DonahueBrian Donahue Posts: 6,590 New member
edited November 25, 2005 11:09AM in SQL Compare Previous Versions
Hi David,

That's interesting... is the script trying to drop the column 'Quantity'
or 'Price'? It seems like the error message doesn't have much to do with
changing the default of the Quantity or Price columns.

Regards,

Brian Donahue
Red Gate Technical Support

"David Walton" <[email protected]> wrote in message
news:[email protected]
> Hi all,
>
> I have SQL Compare 3.1.5.191 and I have to say it's a great product.
> However, I have a problem.
>
> I have a column in a table called Value - it's a computed column based on
> the columns Quantity and Price.
>
> I used the SQL Server 2000 Enterprise Manager to adjust the default value
of
> Quantity and Price to 0.
>
> SQL Compare picks this change up and adds an ALTER TABLE line to the
script.
>
> The problem occurs when the script is run - I get the error message:
>
> The column 'Value' is dependant on column 'Quantity'
> The column 'Value' is dependant on column 'Price'
>
> Is there any way I can overcome this?
>
> Thanks.
>
>

Comments

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

    That makes sense. I suppose the problem is that SQL Compare didn't pick
    up the dependencies on those columns.

    Regards,

    Brian Donahue
    Red Gate Technical Support

    "David Walton" <[email protected]> wrote in message
    news:[email protected]
    > Hi Brian,
    >
    > Neither. The script tries to adjust the columns Quantity and Price with
    the
    > following command:
    >
    > ALTER TABLE [dbo].[Contract Details] ALTER COLUMN [Quantity] [numeric]
    (18,
    > 2) NULL
    > ALTER TABLE [dbo].[Contract Details] ALTER COLUMN [Price] [numeric] (18,
    2)
    > NULL
    >
    > And the error generated during the script processing is:
    >
    > The column 'Value' is dependant on column 'Quantity'
    > The column 'Value' is dependant on column 'Price'
    > ALTER TABLE ALTER COLUMN 'Quantity' failed because one or more objects
    > access this column.
    >
    > Regards
    >
    > David Walton
    >
    > "Brian Donahue (Red Gate)" <[email protected]> wrote in message
    > news:[email protected]
    > > Hi David,
    > >
    > > That's interesting... is the script trying to drop the column
    > 'Quantity'
    > > or 'Price'? It seems like the error message doesn't have much to do with
    > > changing the default of the Quantity or Price columns.
    > >
    > > Regards,
    > >
    > > Brian Donahue
    > > Red Gate Technical Support
    > >
    > > "David Walton" <[email protected]> wrote in message
    > > news:[email protected]
    > > > Hi all,
    > > >
    > > > I have SQL Compare 3.1.5.191 and I have to say it's a great product.
    > > > However, I have a problem.
    > > >
    > > > I have a column in a table called Value - it's a computed column based
    > on
    > > > the columns Quantity and Price.
    > > >
    > > > I used the SQL Server 2000 Enterprise Manager to adjust the default
    > value
    > > of
    > > > Quantity and Price to 0.
    > > >
    > > > SQL Compare picks this change up and adds an ALTER TABLE line to the
    > > script.
    > > >
    > > > The problem occurs when the script is run - I get the error message:
    > > >
    > > > The column 'Value' is dependant on column 'Quantity'
    > > > The column 'Value' is dependant on column 'Price'
    > > >
    > > > Is there any way I can overcome this?
    > > >
    > > > Thanks.
    > > >
    > > >
    > >
    > >
    >
    >
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    This issue has been addressed and computed column dependencies should be calculated correctly in SQL Compare v4 (out soon!)
This discussion has been closed.