简体   繁体   中英

Importing Data Into SQL From Excel

We have report writing software where we can get data from our system and dump it to an Excel file. I have a report that runs daily and then I have a job in SQL that imports that data to a table in one of our databases. The issue I'm running into is if there is no data in the report for that day, the report just says 'No Data Available' and it doesn't import anything or clear out the table so the data from the previous day is still in the table. Is there a way I can get it to clear the table each time whether there is data in that Excel file or not?

If you don't want the data from previous days reports why not just throw:

DELETE FROM [Name of table]

At it before you start your import

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM