BCP:无法解析列级排序规则
运行这个:
bcp MyDb.dbo.uvwMyView out "c:\Test.txt" -SMyServer -T -c
我得到这个错误:
SQLState = S1000, NativeError = 0
Error = [Microsoft][SQL Native Client]Unable to resolve column level collations
搜索谷歌找到了许多可能的解决方案,但没有一个对我有用,也没有对他们建议的任何人有用。与在线发布的其他案例一样,当我在 Management Studio 中进行选择时,该视图不会出现任何问题,并且结果看起来正常(并且没有特殊字符,我检查过)。结果中的一个文本列具有排序规则 SQL_Latin1_General_CP1_CS_AS
。我尝试了几种 bcp 选项,但没有效果:-w、-CRAW、-COEM、-C850、-C437。
我正在使用 SQL Server 2005。
Running this:
bcp MyDb.dbo.uvwMyView out "c:\Test.txt" -SMyServer -T -c
I get this error:
SQLState = S1000, NativeError = 0
Error = [Microsoft][SQL Native Client]Unable to resolve column level collations
Searching google finds many possible solutions, none of which work for me or have worked for any of the people they were proposed for. As with other cases posted online, the view causes no problems when I select from it in Management Studio and the results look normal (and have no special characters, I checked). The one text column in the results has collation SQL_Latin1_General_CP1_CS_AS
. I have tried several options to bcp with no effect: -w, -CRAW, -COEM, -C850, -C437.
I'm using SQL Server 2005.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
删除视图并重新创建它解决了问题。不幸的是,这并不能解释问题最初是如何发生的,或者将来如何预防它。这不是一个令人满意的解决方案,所以如果有人知道更好的答案,我仍然很有兴趣听到它。
Dropping the view and recreating it fixed the problem. Unfortunately this doesn't explain how the problem happened in the first place, or how to prevent it in the future. This isn't a satisfying solution, so if anyone knows a better answer, I'm still very interested in hearing it.
试试这个:
Try this one:
我知道这个问题已经得到解答,但我会加我的 2 美分......
我今天遇到了这个问题,我添加了一个 PRINT @VarableName 并在研究中发现了这个:
来自 MS Connect
删除 PRINT 解决了我的问题。
I know this question is already answered but I'll add my 2 cents...
I ran into this today, I had add a PRINT @VarableName and in researching I found this:
From MS Connect
Removing the PRINT fixed my problem.
我对 SQL 2008 R2 数据库使用 SQL 2005 工具,并且在使用
datetimeoffset
字段时遇到相同的错误。I was using SQL 2005 tools against a SQL 2008 R2 database, and I got the same error when using
datetimeoffset
fields.我刚刚遇到这个问题并找到了不同的解决方案。由于配置错误,未向 BCP 命令提供服务器名称。为了冗余和记录,消息如下:“错误 SQLState = S1 000,NativeError = 0 错误 = [Microsoft][ODBC Driver 13 for SQL Server]无法解析列级排序规则 BCP 复制失败
”将 Server (-S) 参数中指定的服务器值更改为正确的服务器名称。
I just ran into this issue and found a different solution. Due to a configuration mistake, the server name was not supplied to the BCP command. For sake of redundancy and documentation, this the message: "The error SQLState = S1 000, NativeError = 0 Error = [Microsoft][ODBC Driver 13 for SQL Server]Unable to resolve column level collations BCP copy out failed"
Change the a null server value specified in the Server (-S) parameter to the correct server name.