Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Computed Columns???

Author  Topic 

jamiegirl764
Starting Member

30 Posts

Posted - 2001-10-11 : 17:06:48
I'm a newbie and this might be a simple question, but I was wondering if you could create a table that has several computed columns and some of those columns need data from other computed columns. I've gone about it by using the formula of computed column 1 and other non-computed column values. Is this correct?


Also, I was wondering how I would go about it creating a computed column that needs to get a value from another table in order to determine what values will be used in the computation.

For example, this is what I have

CREATE TABLE Options
(Premium MONEY,
Taxes SMALLMONEY,
Fees SMALLMONEY,
Income --MY COMPUTED COLUMN
IF Carrier.Taxes = B
Income AS (Premium + Taxes + Fees)
IF Carrier.Taxes = R
Income AS (Premium + Fees)
)

Is there a way of going about this??? Any help would be great!!! Thanks in advance!

Jay

   

- Advertisement -