sql - How to SELECT [header text w. dot] AS xxx FROM an Excel table? -
summary: using jet.oledb provider , sql query, not know how access column header text of contains dot. there way escape dot in select query?
details: using connection string
provider=microsoft.jet.oledb.4.0;data source=test.xls;extended properties="excel 8.0;hdr=yes;"
when header text of column of excel sheet contains dot (notice dot column named abbrev. packing)...
... select query this...
select [date] d, [code] code, [abbrev. packing] packing, [price] price [sheet1$]
... fails error 80004005. when remove dot header text , select
command, works smoothly, , data extracted. however, excel table comes third party, , cannot change text of header.
how can escape dot in select command, or way fix it?
it appears ssis replaces period (.) number sign (#) when tried load similar spreadsheet provided through ssis package. so, guessing need either load through ssis if have option available, otherwise try querying directly this:
select [date] d, [code] code, [abbrev# packing] packing, [price] price [sheet1$]
Comments
Post a Comment