Database Design - What happens when you add a column in the middle of a table (dbo.Test1) in SQL Server Management Studio?

  • Database Design - What happens when you add a column in the middle of a table (dbo.Test1) in SQL Server Management Studio?

  • Can you elaborate your point?

  • A new table is created with the new column, data is copied into the new table, the old table is dropped, and the new table is renamed to old table name. If you related constraints such as foreign keys, those are dropped and recreated as well.

    Tim Januario

  • Or the world comes to an end. But I think it was my first answer.

    Tim Januario

  • And then why would you insert a new column in the middle any way? It would have to be for simple cosmetic reasons. The order of columns is actually immaterial in SQL Server.

  • Lynn Pettis (2/17/2010)


    And then why would you insert a new column in the middle any way?

    Because it was asked so ... 😉


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • ^^^^ R a j u ^^^ (2/17/2010)


    Database Design - What happens when you add a column in the middle of a table (dbo.Test1) in SQL Server Management Studio?

    What happens ? You end up with a table with 1 more column than it had before.

    Vivek29 (2/17/2010)


    Can you elaborate your point?

    I think the troll is looking for us to do his homework.

Viewing 7 posts - 1 through 6 (of 6 total)

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