Import/Export table definitions using SQLServer Management Studio
How to import/export table definitions from my dev database to producti开发者_C百科on database(recreate the whole database). I have Sql server 2005, Sql Management studio with power shell.
Thanks in advance.
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.
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 | ....
精彩评论