开发者

Move tables from production to development

I have an application and I want to move some of the tables from the production database to the development database to refresh the data on development. I don't need to move all of the tables.

This application is still running on SQL2000 and planned to be upgraded next year. I have SQL2008 installed on my workstation. I was thinking about using SS开发者_如何学CIS for this, but not sure that it will work. Is this the best way or is there something easier? I would like this to be automated so I can do it when needed.

Thanks in advance,

Randy


Check out RedGate's Sql Compare and Data Compare. These tools do exactly what you need to do and they do it well. There are others like Red Gate out there btw, but i've found RG to be the most solid.


You can do this using SSIS pretty easily (and it comes bundled with SQL Server provided that you have it installed).

You can schedule a package to run periodically using SQL Server Agent.

You will have to drop-create the tables and work on the indices and relationships as well.


There are a slew of options.. You could use SSIS, it should work fine, and is probably the easiest to set up. There's a wizard that will guide you through it.

You could also use a linked server on one end that pointsto the other end. and just run a SQL Insert query from the linked server to the destination server. If you did this you could use SQL Agent to schedule it.

   Insert LinkedServer.Schema.TableName 
   Select * From LocalTableName

There are some third party tools that will do this too. Red Gate has a tool called SQL Compare and Data Compare, that not only detect fifferences between two databases, but can generate the sql scripts to modify the database to make them identical.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜