My OS is Windows server 2008.
I've already installed SQL Server Express 2008.
I have several problems:
I got error message : Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be recreated or enabled the option Prevent saving changes that require the table to be re-created.
Example:
I have ID, Name, Phone,
and Status
columns. I am unable to add Address
between Name
and Phone
.
But, I can add Address
if i place it after Status
.
Is there any way to solve this problem?
Thanks before.
To add a column at a specific position within a table row, use FIRST or AFTER col_name . The default is to add the column last. You can also use FIRST and AFTER in CHANGE or MODIFY operations to reorder columns within a table.
In Microsoft SQL Server, we can change the order of the columns and can add a new column by using ALTER command. ALTER TABLE is used to add, delete/drop or modify columns in the existing table. It is also used to add and drop various constraints on the existing table.
By default, columns are only added at the end. To insert a column in the middle, you have to drop and recreate the table and all related objects (constraints, indices, defaults, relationships, etc). Several tools do this for you, and depending on the size of the table, this may be an intensive operation.
In SSMS Tools -> Options -> Designers you would need to uncheck the option "Prevent Saving Changes that require table re-creation" to allow you to do this in SSMS.
This will rebuild the table and so generally isn't worth the hassle if the table is at all large and will make deployment to production trickier.
If there are columns which logically you would prefer to have next to each other to make writing queries easier you can create a View with the desired column order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With