In SQL 2005, you may come across a situation where you need to generate a ALTER TABLE script, such as when adding a new column to a database or changing the field type, etc.
If you want to generate a script for a particular SQL function, such as CREATE, SELECT, UPDATE, etc, you would normally just right-click on the table in SQL Management Studio and choose Script Table as and then the function you want to script.
However, the ALTER To option is disabled in the Script Table as menu option! So if you want to generate a script, how do you go about doing it? Well, you can’t do it this way when you alter a table.
In order to generate the script, you first right-click on the table you want to alter and choose Design.
![]()
Now go ahead and add your new columns, change the field types, set your fields to accept NULLS or not, etc. Once you are done, you want to right-click on any column or in the white space and you’ll see the option Generate Change Script is now available.
Now go ahead and save that file and you’ll have your ALTER TABLE script! It’s a bit confusing since all the other functions can be scripted just by right-clicking, but it’s simple once you learn it. Enjoy!
Related Posts
- Microsoft Is Shutting Down NTLM After 30 Years: Here’s Why Kerberos Replaced It
- Protect Office from Actively Exploited Zero-Day (CVE-2026-21509): Step-by-step Guide
- How to Fix Windows 11 Boot Loops After Jan 2026 Update
- How to Remove Copilot AI in Window 11? New Update Available in Beta
- January 2026 Patch Tuesday: 7 Things Windows Users Should Do Before and After Updating
Founder of Help Desk Geek and managing editor. He began blogging in 2007 and quit his job in 2010 to blog full-time. He has over 15 years of industry experience in IT and holds several technical certifications. Read Aseem’s Full Bio