Right-click script to modify table disabled in SQL Server Management Studio

I want the script table to change to a new query editor window. But this option is disabled. How can i do this?

+45
sql-server alter-table ssms
May 08 '12 at 12:02
source share
3 answers

Use the Design function in SQL Server Management Studio to generate an ALTER script for you:

  • Right-click on the table you want to change and select Design.
  • Add new columns, change field types, set your fields to accept NULLS or not, etc.
  • Once you're done, click the "Create Change" script button (or right-click on any column or in white space). This button looks like a floppy disk hovering over a piece of curled paper.
  • Save the result in a text file

Depending on how you configured SSMS, this may not be available initially if the changes require the tables to be deleted and recreated. To change this setting, from the Tools menu, select Options, Designers, and then Table and Database Designers. Select or clear the Prevent Save check box, which requires the table to be recreated.

+54
May 8 '12 at
source share
โ€” -

1) Right-click on the table you want to change and select "Design"

2) Add new columns, change field types, set your fields to accept NULLS or not, etc.

Important: Do not save your changes now.

3) Right-click on any column or in white space, and you will see that the "Create Change" Script option is now available.

+19
Apr 04 '14 at
source share

In SQL Server Management Studio 2016, the toolbar button icon has changed. See the highlighted icon.

New Icon for Generating Script Changes

0
May 3, '17 at 5:07 pm
source share



All Articles