Home » SQL ServerRSS

Right click script alter table disabled

Does anyone know how to enable the "Script Table As" -> "Alter To" option in SQL Server 2008 SSMS? 
 

3 Answers Found

 

Answer 1

"Script table  As" does not offer an "Alter to" option in SQL Server 2005 SSMS either. 

The Alter can be quite a complicated command, so the scripting wizard does not offer a version of ALTER TABLE.  You have to write the ALTER yourself. 

Of course, if your needs are simple, you might (1) script out a CREATE TABLE script, (2) then modify it slightly as needed and  to have a temporary name, (3) copy the data from the old table to the new one, then (4) drop the old table, and (5) rename the temporary name to the name you want to use.

But if your table is large, working through how to ALTER it is probably better.

FWIW,
RLF

 

Answer 2

I guess this is a UI design issue in SSMS. 

I have no doubt that many people noticing "Script Table As..." / "Alter to" with the text grayed out will assume that it is happening for a semantic reason such as Russell Fields suggested.  In other words, they expect that it will be enabled in some situations, otherwise "why would it be there"?

In reality, I suspect that "Alter To" is simply hard-code into the "script" sub-menu (i.e. a technical explanation) and then grayed out for tables (the semantic part).

If there are no cases where "Table... Alter To" is enable, it should not appear in the UI.

 

 


Wayne Erfling
 

Answer 3

If there are no cases where "Table... Alter To" is enable, it should not appear in the UI.
I agree.  (Unless, of course, it is supposed to be a veiled promise of functionality to come one day.)   - RLF
 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter