Bug perhaps - not sure whats going on

gsuttiegsuttie Posts: 80
If I have say 100 tables in my list of tables within SQL Management Studio and I choose one in the middle of the list and choose to design the table, I then add a column and click save - on the left hand pane (list of tables) the name of the table I just changed is no longer there - I know that if I then refresh the list of tables it comes back but its slightly worrying when the table looks likes it just been deleted - is this dropping the table to recreate it and thats why the names dissappears form the ilst of tables?

Cheers
Gregor

Comments

  • In SSMS it will not drop a table unless you have the "Allow DROP" option ticked with in the preferences. Also, the only time it will drop a table and recreate is if there is a need to.

    Adding a new column to the end of the database table does not but if you drag it around to place it in a specific column order this will. Also, other options you specify as part of the column may cause a drop.

    The best way to see this is by either keeping the Allow Drop option disabled or generating a script of the changes before applying them. If the script creates a temporary table then inserts data from the existing table, it is going to be dropping and recreating.
  • Eddie DEddie D Posts: 1,666 Rose Gold 5
    Thank you for your post into the forum.

    SQL Source Control makes use of the SQL Compare engine. When synchronizing two databases using SQL Compare, a table rebuild is required when the column order has changed to preserve the data in the table to be synchronized.

    Therefore if you add a column to a table and you force the column order, so that the new column is added between existing columns, this will require a table re-build in the manner you have described.

    Many Thanks
    Eddie
    Eddie Davis
    Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
Sign In or Register to comment.