<p>I'd like to automatically generate database scripts on a regular basis. Is this possible.</p>

To generate script for an object you have to pass up to six parameters:
```
```
exec proc_genscript 
    @ServerName = 'Server Name', 
    @DBName = 'Database Name', 
    @ObjectName = 'Object Name to generate script for', 
    @ObjectType = 'Object Type', 
    @TableName = 'Parent table name for index and trigger',
    @ScriptFile = 'File name to save the script'
```
```
http://www.databasejournal.com/features/mssql/article.php/2205291