Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用存储过程将数据从一个表移动到另一个具有相同数据库的表。
每次执行存储过程时,只会将更新的列从一个表复制到 SQL Server 中的另一个表。
您可以使用审计列来实现这一点。
在源表上,您需要添加 ModifiedOn 日期时间列。每当更新源表上的列时,您还需要将 ModifiedOn 列更新为 getdate() 以指定该行已被修改并且列值已被更新。
当您将数据从源表复制到目标表时,如果您跟踪加载到目标表的最后一个 ModifiedOn 值,则可以使用该值在源表上查找具有较大 ModifiedOn 值的行,然后仅加载已更改的行。
标记
使用 xslt 1.0