Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 created a really small database in MSSQL Server 2005 in order to get the SQL it requires to create it on the fly, but I haven't been able to do so. Basically, I want the script that creates the database exactly as I created it using SQL Server Management Studio (I don't care about the data since the database is empty, I only want the schema). I know there is a way to do it, but I don't remember how.

Any help really appreciated.


share|improve this question

Right Click Database>Script Database As>Create To>Output option of your choice. I believe this is what you are referring to?

share|improve this answer
This will give them only the CREATE DATABASE script. It won't script out any of their tables, etc. If you right click on the database and select Tasks > Generate Scripts, this will provide you a wizard that will allow you to script out the database and all its objects. – SQL3D Dec 16 '10 at 17:08
Ahh did not know that! Guess I should pay a little more attention then. – Charles Dec 17 '10 at 15:23

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.