How to get the database structure script from SQL Express?

time to read 2 min | 270 words

Here the scenario, I'm using VS 2005 with SQL Express 2005. I started with a database structure from the schema, and then I started writing code, every so often finding spots where the spec got it wrong, so I would change the table (Naming/Relationships/etc). I did it all inside VS 2005.

The problem: Now I can't get it out.

There doesn't seem to be a way to tell VS 2005 or SQL Server: "Thank you very much, this is the final structure, now give me the script to create it in another database."

I don't need data replication, I just need the create table ... for the entire database. This can be done very easily from Enterprise Manager, but I don't have that on the machine. I can't install it because it require uninstaling SQL Express, and that takes us to the CTP Matching Game. I'm 99.9% sure that if I would do it I would manage to lose my current database.

I tried connecting to it from Enterprise Manager 2000 on another machine, but it refuse to login, even though I'm using Windows Authentication and I can login to the computer from the second machine. Installing the full SQL Server 2005 on another machine is something that will take a couple of hours at least, and even then I'm not guaranteed to have it work (I've very bad experience with the SQL Express line).

So the question is simple, how do I get the table information out of the database?