I frequently receive text and excel files which I have to upload in local MS SQL Server. Is there any tool or command available that can automate this task. For Bulk upload provided by MS SQL you have to create the blank table first, I dont want to create a new table manually each time. Please help
1 Answer
Don't need to create a data table manually . In MS Sql server there is a function for that .
- Right click on Database Name
- Then go to 'Tasks' and then go to the tab 'Import Data' & click on that
- you will get the data export , import wizard, Click next.
If excel file , Select data source as 'Microsoft Excel' then browse the excel file (make sure your excel file save in 97-2003 format). if text file , Select data source as 'Flat File Source' , then browse the file .
Proceed with the wizard , you will get the data table with relevant data.
2 Comments
Anuj Agarwal
Yes I know this feature & I currently use that only but to do it manually for say 10 files is cumbersome. I want that all the files if they are 10 or 20 inside a specific folder should get uploaded at once in sql server.
Rigerta
@AnujAgarwal check out this link: How to loop through files in a specified folder, load one by one and move to archive folder using SSIS
SqlBulkCopyand then run it with a Windows task.