Right click the Database and select Tasks
-> Generate Scripts
.
You can you then select all the objects you require or only certain objects.
There are some Script Options that you should look at:
- Script USE DATABASE - You should set this to false if you are creating a new database with a different name.
- Indexes & Triggers are not scripted as default
- Logins & Object Level Permissions are not scripted as default
- Generate Script for Dependent objects - this is set to false as default but you may want to change it to true to ensure that all objects are scripted.
You can either create these to a new Query Window or save them to SQL Files.