Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.