I know lots of you know this, but let me share it :D
First go to your database,
Login then
Right click your Database, e.g. (RanGame1)
Choose task, under Task, Choose Generate Script
then Next until it finish generating script.
Then one of the step asking for the path of the output script...