在SQL 2k8下写的,在SQL 2K下报错

kevinnick 2010-10-15 08:02:56
在SQL 2k8下写的,在SQL 2K下报错

declare @tpbom table (root1 nvarchar(20), father nvarchar(20), itemcode nvarchar(20), nlevel int, endflag varchar(2) )
declare @level int
select @level = 0

insert into @tpbom select code as root1, code as father, code as itemcode, 0 as nlevel, 'N' as endflag
from oitt
where treetype = 'p' and code between 'FCS092366A' and 'FCS092366A'

while @level < 8
begin
set @level = @level +1

insert into @tpbom select tt.root1, tt.itemcode father, it.code itemcode, nlevel = @level, 'Y' endflag
from @tpbom tt inner join itt1 it on tt.itemcode = it.father and tt.nlevel = @level -1
inner join oitt oi on it.father = oi.code and oi.treetype = 'P'

if(@@rowcount <= 0 or @level > 8)
break
end

update @tpbom set endflag = 'N' where endflag = 'Y' and itemcode in (select code from oitt where treetype = 'p')

SELECT t0.root1[BOM_PD],t1.itemcode[BOM_father],t1.ItemName,
t2.itemcode[BOM_child],t2.ItemName,t3.price,t3.currency,t0.nlevel [level]
from @tpbom t0 left join OITM t1 ON t0.father = t1.itemcode
left join OITM t2 ON t2.itemcode = t0.itemcode
inner join itm1 t3 ON t3.itemcode = t2.itemcode and t3.pricelist = 2
where t0.nlevel<>0


error: 消息 446,级别 16,状态 9,第 13 行
Cannot resolve collation conflict for equal to operation.



请高手帮忙,是哪里的问题呢?
...全文
79 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
dawugui 2010-10-15
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 kevinnick 的回复:]
哈哈,知道了,谢谢啦
[/Quote]恭喜.
kevinnick 2010-10-15
  • 打赏
  • 举报
回复
哈哈,知道了,谢谢啦
dawugui 2010-10-15
  • 打赏
  • 举报
回复
未看出有什么非法词语等内容,帮顶了.
SQLCenter 2010-10-15
  • 打赏
  • 举报
回复
双击这个错误,看看是哪一行出的错
SQLCenter 2010-10-15
  • 打赏
  • 举报
回复
排序规则冲突

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧