开发者

Import/Export table definitions using SQLServer Management Studio

开发者 https://www.devze.com 2022-12-29 00:51 出处:网络
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.

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 | ....

0

精彩评论

暂无评论...
验证码 换一张
取 消