SQL Server 2005 - Syncing development/production databases

99封情书 提交于 2019-11-30 22:23:40

I suggest using RedGate's tools (this is not advertisment, but real life experience with them) that can deploy schema changes and/or data:

  • SQL Compare for schema changes
  • SQL Data Compare for data changes

I used these tools in the past (others as well) and they really helped with development staging process. These tools aren't free but their price is more than acceptable for any development team.

Check RedGate web site

Gage

I know this was answered ages ago but check out http://en.wikipedia.org/wiki/Microsoft_SQL_Server_Compare_Tools

It shows a number of free and paid compare tools.
For example a free tool listed is SQL Server Compare by Yes Soft http://www.yessoft.com/software/sqlservercompare/sqlservercompare.htm


(source: yessoft.com)

Information Provided on the site:
-List of free tools
-List of paid tools
-Features of the tools: Compare, Generate Sync Script, Synchronize, Licensing

Upside: 5 free tools are listed, 21 paid tools listed.
Downside: It is wikipedia. And the links seems to point to wikipedia pages instead of the actual homepages but if you google you will find them.

I'll add my vote for Red Gates tools - they're not expensive & they are useful - we have several complex databases & using a tool like SQL Compare is the only way I'd feel confident about getting the update scripts right. Before we had any tools it was pretty scary sometimes

You can schedule jobs for back up and restore using SSMS. In my view, this is the simplest solution. The frequency of this job will depend on how dynamic is your schema/data.

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

You could always just detach the database copy it then re-atach the db. This strategy only works if its not an issue for the "master" to be unavailable for a few minutes while the copy is carried out.

This is obviously only a snapshot of the db at that moment in time, and if you're looking for a more dynamic solution you may want to look into replication.

You could just backup and restore using the standard SQL Server functions.
That's what we do. We run a daily backup on the production server at 9 pm anyway.

Then at 11 pm, we run a SQL Server Agent job on the test server which restores the last backup from the production server ("RESTORE DATABASE ...").

The only con is: you have to get used to the fact that all changes you make in the test database are away the next morning :-)

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