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.
我需要制作一个 DTS 包来将数据从一个数据库转换到另一个数据库。除了所有 datetime2 字段都已更改为 datetime 之外,这些结构基本相同。尝试对数据库运行 DTS 包时,每次遇到无法在不截断的情况下进行转换的 datetime2 字段时都会失败。我真的不在乎精度,我只需要精确到秒的日期和时间。如果我将 DTS 设置为在截断时忽略而不是失败,它会忽略整行并且我最终没有数据。我如何告诉 DTS 这种截断是可以的?
好吧,我能想出的最佳答案是使用 DTS 源的查询而不是表。在该查询中,将所有 datetime2 对象转换为 datetime 并检查并截断任何无效值。