update item set dj = b.dj from item a join opendatasource(..) b on EXID=id
update t1 set f2 = b.f2 from t1 a join opendatasource('Microsoft.Jet.OLEDB.4.0','Data Source="D:\123.xls";User ID=Admin;Password=;Extended properties=Excel 5.0;Persist Security Info=false')...[Sheet1] b on a.f1=b.f1---(t1是数据库中的表,f1是对比字段,F2是要更新的字段,两个表中字段名相同,执行上面语句提示) 服务器: 消息 7314,级别 16,状态 1,行 1 OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 不包含表 'Sheet1'。该表可能不存在,或当前用户没有使用该表的权限。
update t1 set f2 = b.f2 from t1 a join opendatasource('Microsoft.Jet.OLEDB.4.0','Data Source="D:\123.xls";User ID=Admin;Password=;Extended properties=Excel 5.0;Persist Security Info=false')...[$Sheet1] b on a.f1=b.f1
服务器: 消息 7399,级别 16,状态 1,行 1 OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。 [OLE/DB provider returned message: 找不到可安装的 ISAM。]还是报错,难道是我的机子环境有问题吗?????
from item a
join opendatasource(..) b on EXID=id
from t1 a
join opendatasource('Microsoft.Jet.OLEDB.4.0','Data Source="D:\123.xls";User ID=Admin;Password=;Extended properties=Excel 5.0;Persist Security Info=false')...[Sheet1] b on a.f1=b.f1---(t1是数据库中的表,f1是对比字段,F2是要更新的字段,两个表中字段名相同,执行上面语句提示)
服务器: 消息 7314,级别 16,状态 1,行 1
OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 不包含表 'Sheet1'。该表可能不存在,或当前用户没有使用该表的权限。
from t1 a
join opendatasource('Microsoft.Jet.OLEDB.4.0','Data Source="D:\123.xls";User ID=Admin;Password=;Extended properties=Excel 5.0;Persist Security Info=false')...[$Sheet1] b on a.f1=b.f1
OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。
[OLE/DB provider returned message: 找不到可安装的 ISAM。]还是报错,难道是我的机子环境有问题吗?????
2.将内容插入临时表.
3.写一个存储过程来判断主键相同时进行更新。通过存储过程来执行,速度是很快的,可以尝试!