Update: This article is re-written with SQL Server 2008 R2 instance over here: SQL SERVER – 2008 – 2008 R2 – Create Script to Copy Database Schema and All The Objects – Data, Schema, Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects
Following quick tutorial demonstrates how to create T-SQL script to copy complete database schema and all of its objects such as Stored Procedure, Functions, Triggers, Tables, Views, Constraints etc. You can review your schema, backup for reference or use it to compare with previous backup.
Step 1 : Start
Step 2 : Welcome Screen
Step 3 : Select One or Multiple Database
If Script all objects in the selected database checkbox is not selected it will give options to selected individual objects on respective screen. (e.g. Stored Procedure, Triggers and all other object will have their own screen where they can be selected)
Step 4 : Select database options
Step 5 : Select output option
Step 6 : Review Summary
Step 7 : Observe script generation process
Step 8 : Database object script generation completed in new query window
Reference : Pinal Dave (https://blog.sqlauthority.com), All images are protected by copyright owner SQLAuthority.com
673 Comments. Leave new
How can script out particular schema dependent objects without selecting one by one db objects in Generate script wizard.?
hello pinal,
how are you?
I have a question … i have three database and having a single table in each have the same name like table name is “customer amount”. which contains date and amount. and i want that whenever i choose the date from calender the sum(amount) from all the three db come in a grid in different column.
how do i do so with database query.
thank you in advance!
Without schema and sample data, it would be difficult to provide query.
Pinal, awesome tutorial.
Could you send to me how to automate this process?
I need export data of 300 databases
i want to copy all tables,preocedures,packages,functions etc from a database user(Oracle10g) to a different location so that i can restore the database structure in my home m/c and work on the database
But the indexes were missing. How to get them too?
Hi Pinal,
It was really an awesome tutorial and more helpful.
I also wanted the scripts to be generated automatically. So could you please send me an copy of how to automate this process?
Thanks in advance,
Girish
how to restore sql server 2008 R2 64 bit database on sql server 2005 32 bit database ?
Is it possible?
How do you automate this process?
how can we get this script through t-sql[without uI]