Generate Scripts for database using wizard
We are on deployment phase, It's a time to deploy project to QC side. but the problem is i want to release to empty database to QC for testing.
As per the organization policy i can't provide blank MDF file to them.
so, i need to find some trick that will create a script for me to create Database and all it's tables.
How to deploy
SQL Server 2005/2008 provide us a facility to generate database script with all it's tables. These script contains all it's indexes, primary keys,
identity columns, all collates and cultures
A to Z of script creation
Let's see stepwise procedure to generate database script with all it's tables,
1. Open Microsoft SQLserver 2005/2008 (here i used SQL 2005) and select database for which you want to generate script.
After selecting database -> right click on it --> Tasks --> Generate scripts
Following snap all idea.
2. it will open SQL script wizard, click in Next
3. Third step is to select database from list of databases here my database is Test
4. on next screen there are scripting options by which we can generate script for identity, index, primary key constraints
keep default setting and click on next
5. This step is schema and structure step in which we have to select options for which we have to generate script, here i select tables
6. This step is for table selection, we can select as much table as we want to generate script, here i select all tables, click on next
7. Here SQL gives us a options for script text, we can save script to file in Text and ANSI mode, we can save script to clipboard, and we can put
it in new Query window, here i select new Query window
8. Here SQL server summing up all the inputs.
9.Last step is nothing but success.
so here is the simple way to generate database and it's table script with all schema and structure.
Suggestion and Queries always welcome