SQL Server Solution for importing a data file with SSMS

stszievb  于 2023-10-15  发布在  其他
关注(0)|答案(2)|浏览(121)

SSMS shows me following error while trying to import my .xlsx file containing 3lacs+ rows.

What should I do now?
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. (System.Data) ------------------------------

I was expecting that it will get successfully imported ......whereas previously my files were in .xls format which I guess only has limit of 16383 rows. Hence then I tried using .xlsx format but the issue is as expressed

guicsvcw

guicsvcw1#

The best way is to use the standalone SQL Server XXXX Import And Export Data utility:

wj8zmpe1

wj8zmpe12#

Install the Microsoft Access Database Engine:

Download and install the appropriate version (32-bit or 64-bit) of the Microsoft Access Database Engine from the official Microsoft website. Restart SQL Server Management Studio (SSMS): After installation, restart SSMS to apply the changes.

Ensure Compatibility: Make sure that SSMS and the installed driver have the same bitness (32-bit or 64-bit) for compatibility.

Close Excel Files: Ensure that the Excel file you want to import is not open in Excel or any other application while importing it into SSMS.

After following these steps, you should be able to import your .xlsx file without encountering the error.

If not try converting the file to csv and importing it, it will do what you want.

BULK INSERT dbo.sample_table 
FROM 'D:\PROJECTS\abc.csv'
WITH (
    FIELDTERMINATOR = ';',
    ROWTERMINATOR = '\n',
    FIRSTROW = 2 -- if your file has a header row, set this to 2 to skip it
);

相关问题