April 14, 2010 at 1:14 am
Hello Experts,
Is there a way we can reuse the computed column in a view... For example, I have a column Col1 and a computed column Product that stores the value of (Col1 * 10)
Can i create another computed column that stores the value of (Product + 10) ??? Or i will strictly have to use (Col1 * 10) + 10 ????
Note: Here for example, I have shown sample calculations, In actual the computed column is made up of complex case statements that are cumbersome to use instead of computed column name.
Any help would be greatly appreciated
Regards,
Zain.
April 14, 2010 at 1:40 am
Instead of asking this question and wait for an answer just try to create a table with 2 computed columns that one of them is based on the other one. If you’ll see that it works, then it can be done. If you’ll see an error message saying that your first computed column is not allowed to be used in another computed-column definition, then it can’t be done.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
April 14, 2010 at 2:40 am
It doesn't work..
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply