Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Computed Columns or UDFs???

Status
Not open for further replies.

jamiegirl764

Programmer
Joined
Oct 11, 2001
Messages
1
Location
US
I'm a real newbie to this whole SQL Server 2K. I'm a one person team trying to create a database that has a VB front-end. I hope someone can help me.
I have a table OPTIONs that has columns that gets values based on the values of other columns... I was wondering what a professional would recommend if I need one column's (INCOME) data to be based on 1 column from another table and 2 other columns in the same table.

For example:

The column INCOME in the OPTIONS table is based on these values:

If (Carrier.Type = 'B')
Options.Income = Options.Premium + Options.Taxes + Options.Fees
Else (Carrier.Type = 'R')
Option.Income = Options.Premium + Options.Fees

How would you go about this??? Any tips would be appreciated! Thanks!
 
Personally I would create a view with the calculated column using a case statement.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top