使用 tableDiff 后显示小表的奇数字符

Odd characters showing small table after using tableDiff(使用 tableDiff 后显示小表的奇数字符)
本文介绍了使用 tableDiff 后显示小表的奇数字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQLServer tabeDiff 用于同步数据库. 字符已在目标表中找到.我在任何地方都找不到任何东西,有人经历过吗?这是我的场景.它是一个运行它的 .bat 文件.下面是一个源 table.field 值的示例:

SQLServer tabeDiff is being used to sync DB's. The  character has been found in the destination table. I can find nothing on this anywhere, has anyone experienced this? Here is my scenario. Its a .bat file which runs it. Here is an example of a source table.field value:

SM-33®

tableDiff 之后出现在源 table.field 中:

After tableDiff this appears in the source table.field:

SM-33®

这怎么会发生?源是 SQLServer 2008R2,目标是 SQLServer 2005.

How can this be happening? The source is SQLServer 2008R2, destination is SQLServer 2005.

推荐答案

两个数据库是否使用相同的排序规则?我想这就是导致这个问题的原因.您应该确保它们使用相同的排序规则,然后再次运行 tablediff 实用程序.

Are the two databases using the same collation? I would imagine that is what is causing this issue. You should make sure they are using the same collation and then run the tablediff utility again.

更多信息:

  • 使用 SQL Server 排序规则
  • SQL Server 排序规则基础

更改正在使用的生产数据库的排序规则存在一定的风险.您需要确保它不会破坏当前存在的数据.如果所有当前数据都是 ASCII,那么您可能没问题,但如果您遇到此类问题,听起来就不是这样了.

There is a certain amount of risk in altering the collation of an in-use production database. You need to ensure that it isn't going to mangle the data that is currently there. If all of the current data is ASCII you're probably alright, but it doesn't sound like that is the case if you're having problems like this.

这篇文章:Collat​​ion Hell (第 2 部分) 讨论了更改数据库排序规则所涉及的风险.而这个 technet post 描述了您使用的两个排序规则之间的差异.

This post: Collation Hell (Part 2) discusses the risks involved in changing the collation of a database. And this technet post describes the differences between the two collations you are using.

如果不先在生产数据库的副本上进行测试,我不会这样做.我从来没有真正需要修改正在使用的数据库的排序规则,而且我并不是 100% 了解所有排序规则类型之间的差异,所以我真的不能给你具体的建议.进行一些测试以确保您不会进一步损坏您的数据.

I wouldn't do this without testing it on a copy of the production database first. I've never actually needed to modify the collation of a database that is in use and I'm not 100% across the differences between all of the collation types, so I can't really give you specific advice. Do some testing to be sure you're not going to further corrupt your data.

这篇关于使用 tableDiff 后显示小表的奇数字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL Server Graph Database - shortest path using multiple edge types(SQL Server图形数据库-使用多种边类型的最短路径)
Invalid column name when using EF Core filtered includes(使用EF核心过滤包括时无效的列名)
How should make faster SQL Server filtering procedure with many parameters(如何让多参数的SQL Server过滤程序更快)
How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?(如何使用Microsoft SQL Server Management Studio生成数据库的实体关系(ER)图?)