我如何...在sql2008中联合2个表 [英] How do I...union 2 tables in sql2008

查看:94
本文介绍了我如何...在sql2008中联合2个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法解决UNION操作中Persian_100_CI_AI和Arabic_CI_AS之间的排序规则冲突。



i在以下代码中出现此错误。

$ / b


选择lesscode,lessname,tedadevahed,noedars,magta from tblessons lesscode Not In(从tbentekhabevahed选择Lcode)union选择Lcode,Scode,lessname,tedadvahed,来自tbentekhabevahed的vaziat,其中vaziat ='1'

Cannot resolve the collation conflict between "Persian_100_CI_AI" and "Arabic_CI_AS" in the UNION operation.

i have this error in below code.


select lesscode,lessname,tedadevahed,noedars,magta from tblessons where lesscode Not In(select Lcode from tbentekhabevahed) union select Lcode,Scode,lessname,tedadvahed,vaziat from tbentekhabevahed where vaziat='1'

推荐答案

如果您能够举例,您需要更改表的排序规则其他 [ ^ ]

或在查询示例中执行排序规则这里 [ ^ ]



编辑...



我忘记了只有新创建的对象才能获取数据库中的排序规则更改。这篇CP文章描述并简单解决了这个问题简单方法更改SQL Server中所有数据库对象的排序规则 [ ^ ]
You either need to change the collation of your tables if you are able example here[^]
or do the collation in the query example here[^]

Edit...

I'd forgotten that only newly created objects will pick up the collation changes on a database. This CP article describes and easy way around that problem Easy way to change collation of all database objects in SQL Server[^]


这篇关于我如何...在sql2008中联合2个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆