用存储过程从Excel导入SQL Server的临时表有点行不通!
存储过程属性-新建存储过程:
CREATE PROCEDURE PROtoExcel
@EXN varchar(250)
AS
SET ANSI_NULLS ON
SET ANSI_WARNINGS ON
select * into #temp1 from OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data
Source="D:\Excel2005\28.xls";User ID=Admin;Password=;Extended properties=Excel 5.0;Persist Security Info=false')...[sheet1$]
select 序号 as orderNO,货号 as productNO,品名 as productName,规格 as specification,单位 as
Unit,数量 as Quantity,完成 as finished,备注 as Remark from #temp1
go
按"语法检查(C)时"提示:语法检查成功
但是按"确定"时提示:"错误7405:异类查询要求为连接设置ANSI_NULLS和ANSI_WARNINGS选项.这将确保一致的查询语义.请启用这些选项,然后重新发出查询."
请各位帮帮???TKS!