Server Fault is a question and answer site for system and network administrators. 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

I'm developing an application that connects to a SQL database which I am managing with SQL Management Studio. With each version of my app that I save in source control I want to also save a copy of the database schema that worked with that version. It seems that saving a SQL script to generate the database would be the best way to save this information, but what is the best way to do that? When I right click on my database in Managment Studio it appears that there are two options that may work "Tasks->Generate Scripts" and "Script Database As". What is the difference between these? Which should I use?

share|improve this question

Script Database As only creates a script for creating the Database. If you use Generate Scripts it will start a wizard where you can choose to include all the database objects (tables, stored procedures, etc...). Always save the script to source control.

share|improve this answer

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.