How can I check if BULK INSERT is running on a table?


A BULK INSERT command may take a long time to run.

I have a program that receives multiple files and pushes them to the DB using the BULK INSERT command to a specific table. After a file is uploaded, the program deletes it and moves to the next.

The BULK INSERT command may continue to run on the DB after the program stopped. so a file may be loaded to the DB, or still in process when my program starts.

So, my questions are:

  1. Can I tell if a BULK INSERT command is still running for a specific table?
  2. Can I tell if a file has been already loaded to the DB?