Bug perhaps - not sure whats going on

A SQL Server Management Studio add-in to source control your database in Subversion or Team Foundation Server.

Bug perhaps - not sure whats going on

Postby gsuttie » Thu Nov 11, 2010 4:28 pm

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?

Posts: 43
Joined: Wed Nov 30, 2005 9:09 pm
Location: Glasgow, Scotland

Postby markv » Fri Nov 12, 2010 5:30 pm

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.
Posts: 14
Joined: Tue Jul 06, 2010 4:47 pm

Postby eddie davis » Mon Nov 15, 2010 1:03 pm

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 Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
Posts: 998
Joined: Wed Jun 14, 2006 3:47 pm
Location: Red Gate Software

Return to SQL Source Control Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests