Persisted Columns

  • Ed Wagner (9/2/2014)


    I learned something new today. I didn't know about the add persisted syntax either. Got it wrong, but still learned something, so thanks for the question.

    +1 Thanks for the question Steve.



    Everything is awesome!

  • The reason dropping and recreating the column is marked as wrong is because it says

    "You must drop and recreate the column with the PERSISTED attribute"

    That is incorrect. You can do this, but you do not have to. You can alter the column.

  • Nice question Steve. I was impatient and did not look far enough into the documentation to get this right. I just chose the drop and recreate option because that has always worked for me in the past.

  • danrst171 (9/2/2014)


    Gazareth (9/2/2014)


    Hmm, not great to have a perfectly valid answer marked as wrong!

    Nice to know you can add the persisted property without dropping though.

    I wonder if there's any real difference between the two methods behind the scenes, other than to the metadata.

    I guess it is incorrect because of the wording.

    The other answer was "You must...", but because there is an alternative, you don't have to do that.

    I'd agree with that. When the answer is an absolute like that and another valid answer exists, then the option with the absolute is incorrect.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Good question, Steve.

    I've been working with computed columns a lot these days as part of a change we're implementing.

    ---------------
    Mel. ๐Ÿ˜Ž

  • Koen Verbeeck (9/2/2014)


    Nice question, didn't know about this syntax.

    Me neither, though could guess it right ๐Ÿ™‚

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • Nice Question Steve. Thanks for sharing

  • twin.devil (9/3/2014)


    Nice Question Steve. Thanks for sharing

    +1

    Learned new syntax

    Thanks

  • Nice questions! I got it wrong, but learned a new way of changing the persisted attribute. Dropping and recreating should have worked too, but this is probably easier.

    /Hรฅkan Winther
    MCITP:Database Developer 2008
    MCTS: SQL Server 2008, Implementation and Maintenance
    MCSE: Data Platform

  • Nice question

Viewing 10 posts - 16 through 24 (of 24 total)

You must be logged in to reply to this topic. Login to reply