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 Administration (2000)
 Computed Column in a Table (not query)

Author  Topic 

SQLServerDBA_Dan
Aged Yak Warrior

752 Posts

Posted - 2001-05-16 : 17:18:30
Below is a table that our web developers (consulting company) create. The decisions on how to create the DB for our website were made long before I started here. I found the below table while I was randomly searching for something. My question is are there any ups to using a computed column? I know that the column is not stored in the DB... The original developers are now long gone and the project manager said that there was some reason...some performace enhancement that a computed column in a table gave and that's why they decided to use it. I have looked through 5 SQL books MSDN and BOL. BOL has a very very short write up but nothing useful.

Does anyone know a lot about the computed columns when used in a table?



CREATE TABLE [dbo].[PaymentHistory] (
[LoanID] [varchar] (9) NOT NULL ,
[ReceivedDate] [smalldatetime] NOT NULL ,
[PaymentDueDate] [smalldatetime] NOT NULL ,
[PaymentTypeID] [varchar] (5) NOT NULL ,
[Principal] [money] NULL ,
[Interest] [money] NULL ,
[Misc] [money] NULL ,
[AmountReceived] AS ([principal] + [interest] + [misc])
) ON [PRIMARY]


Daniel
SQL Server DBA

Edited by - SQLServerDBA_Dan on 05/16/2001 17:19:34
   

- Advertisement -