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.


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.

  • 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
  • 1
    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
  • 2
    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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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