SQL Server 2008排序规则冲突

时间:2012-06-30 18:18:54

标签: sql sql-server-2008 collation

这是我在存储过程中遇到的奇怪错误,

  

无法解决“Latin1_General_CI_AI”之间的排序规则冲突   和“SQL_Latin1_General_CP1_CI_AS”中的等于操作。严重   16州9   在调试时我发现问题出现在两个表之间的连接中,其中一个表被临时表填充。奇怪的是,我没有在我的测试环境中得到错误,但是在实时生产服务器上出现了这个错误

花了一些时间找到一个有效的解决方案,所以我回答了我自己的问题,现在正在编辑这个问题,以便其他用户能够更好地理解这个问题。

1 个答案:

答案 0 :(得分:2)

i am getting the change to answer my own question
well the problem was related to collation type of databases,
in my proc i was useing temp tables by "create table #temptable" , 
now by some searching i found that #temptable is having the collation type of temp database which is different from my database, 
after changing the script to "select * into #temptable" ,I got that now #temptable is having same the collation as of my database, so that's how issue get resolved.
not sure this is the only reason behind the problem but it resolve my issue.