As DBA, Copying database objects like tables, stored procedure, views, triggers either on UAT or DEV. Schema refresh is another example of copying all database objects to another instance. In sql server 2008 and r2, you can use generate script wizard to script out entire database object.
Follow the steps below to script out entire database objects
1. Select the database that you want to script out. Right click on it, select Tasks then Generate Script option.
2. It will display the introduction of generate script wizards, click on next to proceed.
3. Here, you can select one option out of two. One is to script entire database and all database objects.
4. In second option, you can choose database objects that you want to script out. In my case, we are going with default option. click next to proceed.
5. Now save all scripts either in file or in new query window, we have selected default option.
6. Here, you will see confirmation that all database objects are successfully copied in file.
Bingo click on finish to complete. Now you will see all script are copied in file.