• I use this to script all the objects to files. As I recall, the .exe is not in 2005, so I copied it, and maybe a couple others from my 2000 server: scptxfr.rll, scriptin.exe, sqlresld.dll.

    I build a temp table with the databases I want to script, then loop through each database name:

    --- Script out Database objects

    set @code = '"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\scptxfr.exe" /s MyServerName ' + ' /d ' + @DatabaseName + ' /I /F '

    + '\\UNCServerToWriteTo\SQLBACKUP\MyServerName\Object_Scripts\' + @DatabaseName + '_structure_'+ convert(varchar(8),getdate(),112) + '' + ' /q /A /r'

    --select @code

    EXEC master..xp_cmdshell @code

    Looks like it scripts pretty much all the database objects. I started using it as an extra layer of backup before we had change controls in place, and as a way to recover code without having to restore a 1Tb database.