In addition to the backup operation that restores everything, you can also use the Generate Scripts option in SQL Server Management Studio to create a text dump of all tables, keys, stored procedures, users, etc. This option is available by selecting your database (left-click once), right-click to get the options menu, then select "Tasks" (which opens a new submenu) and then "Generate Scripts ...". Please note that the script wizard is NOT an option to "Script Database As". The "Script Database As" option is very limited and will not give you many of the database objects needed to fully restore the schema.
source
share