2

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

5
  • 4
    Sounds like you're after SSIS? Commented Jul 27, 2017 at 9:23
  • 2
    If not SSIS, Powershell could do this in some lines of code as well, using SqlBulkCopy and then run it with a Windows task. Commented Jul 27, 2017 at 9:29
  • Could you please elaborate on SSIS Commented Jul 27, 2017 at 10:39
  • Are all the files so different that they need a special table each? Commented Jul 27, 2017 at 12:49
  • Yes they have completely different field names and data types. Commented Jul 27, 2017 at 14:03

1 Answer 1

3

Don't need to create a data table manually . In MS Sql server there is a function for that .

  1. Right click on Database Name
  2. Then go to 'Tasks' and then go to the tab 'Import Data' & click on that
  3. you will get the data export , import wizard, Click next.
  4. 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 .

  5. Proceed with the wizard , you will get the data table with relevant data.

Sign up to request clarification or add additional context in comments.

2 Comments

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.