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.


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.

  • 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

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


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.