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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to creat a view with calculated column

Status
Not open for further replies.

hlac

Programmer
Nov 20, 2001
7
CA
Hi! Can anyone show me how to setup a View with calulated column in SQL2000?
 
Do you mean that you want to add a column to a View that contains a values calculated from columns in a table or tables? If so this is the nasic syntax.

Create View vTblWithComputedValue As

-- This view returns 3 columns from the table and
-- a value computed as the product of ColB & ColC

Select
ColA, ColB, ColC,
ColB * ColC As CompVal
From TblName Terry L. Broadbent
Programming and Computing Resources
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top