有关如何处理归档的动态模式更改的任何建议? [英] Any suggestions on how to handle dynamic schema changes for archiving?
问题描述
所以情况就是这样。我有一个数据库,它可以从salesforce中的数据复制到SQL服务器中。然后我有另一个数据库,其中是一个存档数据库。这里的前提是我正在复制被复制的salesforce数据库中标记为IsDeleted ='true'的所有项目。
所以目前我正在使用SELECT * INTO [Archive Database] FROM [ReplicatedDatabase]类型的东西。好吧,只要架构没有改变,这就是花花公子。
SO,我的问题是,当[Replicated Database]中的架构发生变化时,我不再使用SELECT * INTO例程,因为它依赖于列位置。有什么我可以做的来简化这个,或者我将不得不为列插入查询编写一个巨大的动态列?
希望这对某人有意义。
感谢您的阅读。
我的解决方案是使用SqlPackage.exe来处理这个问题。
Hi,
So here's the situation. I have a database that gets replicated into a SQL server from data in salesforce. I then have another database in which is an archive database. The premise here is that I am copying all items from the replicated salesforce database that are marked as IsDeleted = 'true'.
So currently, I am using a SELECT * INTO [Archive Database] FROM [ReplicatedDatabase] type of thing. Well, this works dandy as long as the schema doesn't change.
SO, my question is, when the schema changes in the [Replicated Database], I can no longer use the SELECT * INTO routine as it relies on column position. Is there anything I can do to simplify this, or am I gonna have to write a huge, dynamic column for column insert query?
Hope this makes sense to someone.
Thanks for reading.
My solution was to use SqlPackage.exe to handle this.
这篇关于有关如何处理归档的动态模式更改的任何建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!