I have a Excel table with 47 columns and 14K rows. I import this data to SQL Server with OPENROWSET
:
INSERT INTO dbo.my_table
SELECT * FROM OPENROWSET
(
'Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;HDR=Yes;Database=C:\ExcelFile.xlsx',
'SELECT * FROM [Sheet1$]'
);
However, only 5138 rows were imported. After some time the number of imported rows decreased down to 5052, i.e. every time - different number of rows.
However, when I use Tasks -> Import Data...
, then all rows are successfully imported.
What's the reason of such behavior?
I'm using SQL Server 2017 14.0.3356.2.