Exporting a SQL Server 2005 Database to a Script

How do we script our SQL Server 2005 database? This was a question we needed to answer today. It surprised me that the answer was not obvious after a quick search on Google. I thought I should write about what we did, so I would not forget and others [...]