Using Sql Server 2008 R2 (but I could possibly upgrade if required).
I want to generate scripts for the database structure as well as the data for a schema.
The Generate Scripts wizard does what I want but I need to be able to automate it (so needs to be called from T-SQL or alternatively external program).
How can I do this?