1. Right click on current database
2. Tasks
3. Generate Scripts...
4. Sql server Script wizard click next
5. Select a database and click Script all objects in the selected database
6. Click next
7. Click finish