• deepak.a (10/15/2010)


    Hugo Kornelis (10/15/2010)


    deepak.a (10/15/2010)


    one more doubt on creating the index on computed columns

    (...)

    in the above Quesries second one (Query 2) thrown on error while creating the index on computed column but the Query 1 and Query 3 not thrown error i'm confused about this

    As implied by the text of the error message, a computed column that SQL Server considers imprecise can not be indexed without first pesisting it. But a computed column that is not imprecies can be persisted.

    All results of calculations with floating point data is considered imprecise, that's the reason you get the error in query 2.

    thanks for your reply hugo , but in query 3 i have used decimal (decimal(18,2))data type for that there s no error thrown

    That's because decimal(18,2) is NOT imprecise, whereas float is.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/