0

How can I import data from Excel to SQL Server using MS Task Scheduler

Dale K
  • 25,246
  • 15
  • 42
  • 71
  • Google helps occasionally: https://learn.microsoft.com/en-us/sql/relational-databases/import-export/import-data-from-excel-to-sql?view=sql-server-2017#linked-servers or: https://community.powerbi.com/t5/Power-Query/best-way-to-push-data-from-excel-to-sql-server-no-of-rows-keep/td-p/107182 – droebi Oct 30 '19 at 11:36

1 Answers1

0
  1. Create a stored procedure with Bulk Insert in SQL Server. In Bulk import query itself you can specify the file location and Table structure. Refer this link for Bulk insert
  2. Create a batch file and call the stored procedure using SQLCMD command. Refer this link for Example
  3. Task Schedule the batch file using windows task scheduler. Refer this link
Dale K
  • 25,246
  • 15
  • 42
  • 71
Shriram R S
  • 126
  • 4