解决方案 »
- 关于set nocount on的作用域问题!请教
- sqlserver JOB 问题
- 求一sql语句
- SQL查询???
- 几个选择和判断题问高手
- 在用left out join关联两个表的时候,发现速度很慢,用什么方法可以代替它来提高速度呢?
- 请高手帮帮忙:将原主键删除,改用其它字段作为作为主键,如果将原表的数据精简后转到新表中?
- 存储过程中表名作为参数如何用在游标中
- 求一SQL语句:两次购买时间间隔
- 急急急急!!!!请推荐几本SQL server7.0或2000的好书!重奖!!!
- windows 2003 MSSQL 2008R2 执行操作时突然断电
- SQL2012单用户模式测试失败-***只有一位管理员可连接***
EXEC sp_configure 'show advanced options',1;
GO
RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries',1
GO
RECONFIGURE
GO
insert into ItemStatistics(Xh,ItemNo,StarDate,Fund,ItemName,OnUnit,ManageUnit,PlanCate,SubCate,ManageDepartment,ItemPI,EndDate,Status,AcceptNo,AuthenticateNo)
select Xh,ItemNo,StarDate,Fund,ItemName,OnUnit,ManageUnit,PlanCate,SubCate,ManageDepartment,ItemPI,EndDate,Status,AcceptNo,AuthenticateNo from
OpenDataSource('Microsoft.Ace.OLEDB.12.0','Data Source="C:\pmdata\importtable0918.xlsx";Extended properties="Excel 12.0;HDR=Yes"')...[sheet2$]
go
EXEC sp_configure 'show advanced options',1;
GO
RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries',1
GO
RECONFIGURE
GO
insert into ItemStatistics(Xh,ItemNo,StarDate,Fund,ItemName,OnUnit,ManageUnit,PlanCate,SubCate,ManageDepartment,ItemPI,EndDate,Status,AcceptNo,AuthenticateNo)
select distinct Xh,ItemNo,StarDate,Fund,ItemName,OnUnit,ManageUnit,PlanCate,SubCate,ManageDepartment,ItemPI,EndDate,Status,AcceptNo,AuthenticateNo from
OpenDataSource('Microsoft.Ace.OLEDB.12.0','Data Source="C:\pmdata\importtable0918.xlsx";Extended properties="Excel 12.0;HDR=Yes"')...[sheet2$]
go
借用2楼的代码