Sql-server – Display query which SSMS executes from Interface/WYSIWYG edits

sql serverssms

If I am to add a new column to a table in SQL Server Management Studio 2008 via the interface/WYSIWYG (as opposed to writing a SQL query) this will, behind the scenes, create a SQL query which it will execute to perform the requested changes.

Is there any way to capture these SQL queries so that I am able to easily execute them on another server, without using SSMS, or re-writing the query.

Best Answer

When you make the changes, there's a menu option "Table Designer". Under there is the option to Generate a Change Script.

There's an option there to automatically generate the script on future changes too.