Rename column

  • PravS

    SSC Journeyman

    Points: 93

    Comments posted to this topic are about the item Rename column

  • Jamsheer

    Ten Centuries

    Points: 1136

    Good question PravS.. Its a new information to me.. I could also look at what cause when other fields renames.. Thankzz..

  • PravS

    SSC Journeyman

    Points: 93

    PravS (7/24/2012)


    Comments posted to this topic are about the item <A HREF="/questions/Database/91763/">Rename column</A>

    I know the answer, but my question is, why a computed column can't be renamed? What's stopping it.

    Respected Seniors \ Veterans ,need your views here.

  • Lokesh Vij

    SSChampion

    Points: 10836

    Though I got this correct, but I always thought you cannot remane (only) participating columns. Nice question 🙂

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • Lokesh Vij

    SSChampion

    Points: 10836

    One more thing: If I try to execute this code, why I am getting the error message two times?

    Caution: Changing any part of an object name could break scripts and stored procedures.

    Msg 4928, Level 16, State 1, Procedure sp_rename, Line 547

    Cannot alter column 'Col3' because it is 'COMPUTED'.

    Caution: Changing any part of an object name could break scripts and stored procedures.

    Msg 4928, Level 16, State 1, Procedure sp_rename, Line 547

    Cannot alter column 'Col3' because it is 'COMPUTED'.

    Msg 0, Level 20, State 0, Line 0

    A severe error occurred on the current command. The results, if any, should be discarded.

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • PravS

    SSC Journeyman

    Points: 93

    Yes, i have seen it....but i do not know what's happening internally

  • Carlo Romagnano

    SSC-Insane

    Points: 21810

    You can't rename a PERSISTED computed column, too!

    Why?

  • This was removed by the editor as SPAM

  • DugyC

    Hall of Fame

    Points: 3804

    Does seem a strange rule, good question thx

    _____________________________________________________________________
    [font="Comic Sans MS"]"The difficult tasks we do immediately, the impossible takes a little longer"[/font]

  • (Bob Brown)

    SSCrazy

    Points: 2705

    Nice question. Thanks for a new bit of knowledge about Rename.

  • Thomas Abraham

    SSChampion

    Points: 10761

    Thanks for the interesting question. Once again, it's nice to see the newer site members getting involved in the QotD.

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • sestell1

    SSChampion

    Points: 10230

    Thanks for the question!

    I don't use computed columns often, so this is very good to know!

  • Dana Medley

    SSCertifiable

    Points: 6764

    sestell1 (7/25/2012)


    Thanks for the question!

    I don't use computed columns often, so this is very good to know!

    +1. I don't use them that often either, so I learned something today. Thanks for the great question.



    Everything is awesome!

  • Sean Lange

    SSC Guru

    Points: 286471

    Nice straight forward question. Keep them coming Pradeep.

    _______________________________________________________________

    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/

  • SQLRNNR

    SSC Guru

    Points: 281210

    sestell1 (7/25/2012)


    Thanks for the question!

    I don't use computed columns often, so this is very good to know!

    +1

    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

Viewing 15 posts - 1 through 15 (of 28 total)

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