日期:2014-05-18  浏览次数:20453 次

大家给我 看看这条sql错哪了,该如何写,在线等!!!
update   opendatasource(
'sqloledb ',
'data   source=www.yy.net;user   id=sa;password= '
).xg.dbo.kroa_wuliu_ruku   as   y
set   lei=1
from   kroa_wuliu_ruku   as   b
set     b.pinming=y.pinming   and   b.kuwei=y.kuwei   and   b.pihao=y.pihao     and  
(b.lei <> y.lei   )
为什总提示:
在关键字   'as '   附近有语法错误。

------解决方案--------------------
from kroa_wuliu_ruku as b
where --这里不是set


------解决方案--------------------
--try

update y
set lei=1
from opendatasource(
'sqloledb ',
'data source=www.yy.net;user id=sa;password= '
).xg.dbo.kroa_wuliu_ruku as y inner join kroa_wuliu_ruku as b
on b.pinming=y.pinming and b.kuwei=y.kuwei and b.pihao=y.pihao and
(b.lei <> y.lei )
------解决方案--------------------
update opendatasource(
'sqloledb ',
'data source=www.yy.net;user id=sa;password= '
).xg.dbo.kroa_wuliu_ruku
set lei=1
from opendatasource(
'sqloledb ',
'data source=www.yy.net;user id=sa;password= '
).xg.dbo.kroa_wuliu_ruku as y ,kroa_wuliu_ruku as b
where b.pinming=y.pinming and b.kuwei=y.kuwei and b.pihao=y.pihao and
(b.lei <> y.lei )