Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 4 down vote accepted

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.

share|improve this answer
What dialog? When I click the save button, it just removes the "unsaved" asterisk from the current tab. – Curt May 20 '13 at 12:39
mea culpa - brain still not working. I've updated my answer with the right answer. – Thomas Rushton May 20 '13 at 12:42
There is also a button that looks like a script with a floppy disk. If you hover over it, it should read 'Generate change script'. The button is part of the table designer toolbar. – twoleggedhorse May 20 '13 at 12:46
Spot on! Found the menu option and toolbar option, exactly what I was after – Curt May 20 '13 at 12:47
The problem with the toolbar is that it mightn't be visible / showing. It's less likely that the menu option will be missing! – Thomas Rushton May 20 '13 at 12:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.