How to copy SQL Azure schema to another SQL Azure database? [closed]

送分小仙女□ 提交于 2019-12-13 15:47:19

问题


I have developed/managed my dev database in SQL Azure, but I can't figure out how to copy the schema of my dev SQL Azure database so I can upload it to my production SQL Azure database? I have heard of other third party tools, but is this the best way? If so, what is a good tool to use for this?


回答1:


http://sqlazuremw.codeplex.com/ is also a quite simple to use and efficient tool




回答2:


If your production database is empty and you just need to clone your current dev database - you can export your DevDB to .bacpac file and then import back it on production server.

Old portal have that functionality there: Database->subscription->server->Pick database, import\export on the top.

New portal: DB, click on servers tab, select server -> databases tab, Import\Export buttons on bottom panel

If you need just migrate your schema to production database, which filled with data and should't be interrupted - you can create SQLProject type (if i remember correctly - you need SQL Server Data Tools, SSDT. Also its available with SQL2012 Tools\Studio) and then you can compare your Azure DB Schema to empty project and script schema back to sql constructs. Then just publish newly created scripts to your production database.




回答3:


Two tools you should never do without when working with SQL are SQL Compare and SQL Data Compare by Redgate. They have saved me countless hours of work and will streamline what you want to do. I've used them with azure and they work well and do the job for us.

See http://www.red-gate.com/products/sql-development/sql-developer-bundle/

The first product will compare and create your schema and the second will let you synch your data. Sometimes it's just better to pay for the right tools and this is that case.




回答4:


SQL Azure MW (http://sqlazuremw.codeplex.com/) works ok, although it did fall apart on me a couple of times when working with a lot of tables in the schema.

Another option is also Azure Data Sync, but as far as I know, it also doesn't want to work if you have more than 500 tables in your database.

What I did in the end is sqlcmd with the SQL dump of the database:

http://msdn.microsoft.com/en-us/library/windowsazure/ee336280.aspx

that took ages, but worked fine. The big problem is how to get it back locally :-)



来源:https://stackoverflow.com/questions/12921254/how-to-copy-sql-azure-schema-to-another-sql-azure-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!