I'm currently working on a C# program that needs to generate an SQL script. I've discovered that the SQLDMO API will allow me to do everything that the SQL Management Studio can do. The SQL Management Studio can generate scripts by doing the following:
Right click on database object >> Tasks >> Generate Scripts.
In my program I need to create a script file just like the above would produce.
Can anyone help explain how to do this, or point me in the direction of a good tutorial.