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.

In SQL Server 2008 it is possible to script data from SQL Server Management Studio.

I would like to make a job, that scripts everything in my database (tables, stored procedures etc) to one file and all data in some tables to another.

Is it possible - and what is the easiest way to do it?

The reason why I want this is so I can put my development databases under source control.

share|improve this question

2 Answers 2

Right click on the database, and select Tasks, then Generate Script. In the wizard on the options page, change Script Data from false to true.

share|improve this answer
    
That is not what I asked. I want to automate it, so I can run it in a scheduler that does what you just described. –  Kjensen Aug 25 '09 at 22:48
    
There's no native way to script out the database or the data. I'm not sure if the their party tools can be scheduled to do this either. –  mrdenny Aug 26 '09 at 1:13
up vote 0 down vote accepted

ScriptDb from Elsasoft does this. It is an open source commandline app from Elsasoft.

share|improve this answer
    
Updated version is over at codeplex now: scriptdb.codeplex.com –  Scott Whigham Sep 8 '09 at 14:28

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.