How to edit existing tables with SQL Server 2008 when changes would require recreating the table?

Posted: (EET/GMT+2)

 

If you have been using SQL Server Management Studio to maintain your database tables, suchas by deleting and adding fields (which often happens during development), you might have noticed that SQL Server 2008 and 2008 R2 do not anymore allow you to alter your tables in design mode as freely as before.

For instance, when adding a new field, Management Studio might inform you: "Saving changes is not permitted. The changes you have made require the following table to be dropped and re-created". However, the same change used to work with SQL Server 2005 (and its management tools). What should you do?

The quick solution is to remember that you can still add new fields by right-clicking your table and choosing Design, but you cannot add new fields to the middle. You can however freely add new fields at the bottom. Yes, this is not perfect, but works nonetheless. In your application code and your SQL or LINQ queries, you can specify the order of returned fields and/or the order in which you process them.