views:

39

answers:

2

Hi,

How to import/export table definitions from my dev database to production database(recreate the whole database). I have Sql server 2005, Sql Management studio with power shell.

Thanks in advance.

A: 

You can do tables or the entire database.

For a table go in your dev SSMS object explorer: right click the table, click "Script Table As" then "Create To" then "clipboard" or "file". Paste the clipboard or open the file into your production SSMS query window and press f5 to run the script.

For a database, go in your dev SSMS object explorer: right click the database, click "Tasks" then "Generate Scripts", then use the wizard to pick all the objects to include (triggers, roles, schemas, stored procedures, tables, etc..) save this to a file and then open the file into your production SSMS query window and press f5 to run the script.

KM
A: 

You could create the SQL needed to re-create the database by right clicking on the database node in Management Studio's Object Explorer, and selection Script Database As | Create To | ....

Richard
I tried that and it only gives you some database settings in the script, not all the objects.
KM
@KM: Perhaps you could expand the question to list the issues you are having in a little more detail.
Richard
@Richard, I'm not the OP
KM