- Right click your database in your server, and select
Tasks > Generate Scripts
. - At Introduction step, click Next.
- At Choose Objects, you can either select either the entire database (including functions, and etc) or specify what objects you want to generate. In your case, you should select
Script entire databases and all database objects
then hit Next. - Choose your file name and destination then click next
- Review and then click next
- Done!
You will see a .sql file generated in your specified folder. You can open that file in other servers and hit execute, it will then generate a exact same database.