Sergiy (2/25/2013)
Sean Lange (2/25/2013)
.. you would need to add the computed column to your base table.or create an indexed view.
There are requirements to meet though - check BOL for details.
Not sure I follow you here. You don't need to have an indexed view to have a calculation in it. The point of using PERSISTED is so that the engine does not have to calculate the value every time you retrieve a row. It does this by physically storing the results in the table. A view does not store any data so the calculation would not be stored. I agree though that an indexed view sounds like the best solution for the OP's situation.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/