Altering columns used in a computed column

Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
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" <dave@cmssoftwaresystems.com> wrote in message
news:PWkLHw3MEHA.1508@server53...
> 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 Bronze 1
    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" <dave@cmssoftwaresystems.com> wrote in message
    news:mMOLvtENEHA.1220@server53...
    > 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)" <brian.donahue@red-gate.com> wrote in message
    > news:EmQ02jENEHA.1220@server53...
    > > 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" <dave@cmssoftwaresystems.com> wrote in message
    > > news:PWkLHw3MEHA.1508@server53...
    > > > 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.
    > > >
    > > >
    > >
    > >
    >
    >
  • This issue has been addressed and computed column dependencies should be calculated correctly in SQL Compare v4 (out soon!)
This discussion has been closed.