Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Decision Factor: Benefits of Computed Columns

$
0
0

Any computed column can be computed in a query. So how do you decide when to design a computed column?

In the following BOL example the hard-wired expression may make it a good candidate for a (server-side) computed column: you don't want the developers to get confused and reinvent their own formula for thebusiness rule to calculate RetailValue in client apps:

ALTER TABLE dbo.Products ADD RetailValue AS (QtyAvailable * UnitPrice * 1.5);
Provide example with your post. Thanks.


Kalman Toth Database & OLAP Architect SELECT Video Tutorials 4 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012








Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>