SQL Management Studio allows you to open a table in design mode, make changes then generate a “change script”.
The change script allows you to see exactly what changes will be made when you click ‘Save’, and where you have a test and production database you will also be able to use the change script to apply the exact same changes to the other database.
- Using SQL Management Studio, right-click on the table and select ‘Design’
- Make the changes required, in this example we’re creating a new column called “New_Column”
- Right-click in a blank area of the design window and select ‘Generate Change Script’
- A new window will open with the change script displayed. You can choose to copy and paste the whole change script or click ‘Yes’ to save to a text file.
- Remember – the changes have not yet been committed to your table, you will need to either save the changes to the table to run the change script to commit the changes.