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.
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
You need to use OPENROWSET
Check this question: import-excel-spreadsheet-columns-into-sql-server-database
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With