202 questions
Right-click the database in Object Explorer, select Tasks from the context menu. In the submenu that opens, select Generate Scripts.
At some part in the wizard, you come to a window where is an Advanced button. Here you can select what is scripted. Some objects are not scripted by default.