How to Bulk Insert from XLSX file extension?

SƲmmēr Aƥ picture SƲmmēr Aƥ · Oct 29, 2012 · Viewed 100.8k times · Source

Can anyone advise how to bulk insert from .xlsx file?

I tried the below query already:

BULK INSERT #EVB FROM 'C:\Users\summer\Desktop\Sample\premise.xlsx' 
WITH (FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', FIRSTROW = 2);

SELECT * FROM #EVB

I also tried with FIELDTERMINATOR like "**\t**", "**,**", "**;**", "**|**", but this doesn't work either.

Unfortunately, there is no error message.

Answer

wootscootinboogie picture wootscootinboogie · Oct 29, 2012

you can save the xlsx file as a tab-delimited text file and do

BULK INSERT TableName
        FROM 'C:\SomeDirectory\my table.txt'
            WITH
    (
                FIELDTERMINATOR = '\t',
                ROWTERMINATOR = '\n'
    )
GO