After I upload a text file to a document library I would like to copy it's contents to a SQL table. How can I extract the contents before or after it gets in to the document library using workflow? I've run out of ideas.
You can hook into different event receivers that are triggered by item/document creation, updating and deletion.
These events fire before (synchronously) and after (asynchronously) the document is created, eg. ItemUpdating, ItemUpdated.
Be aware that adding documents will trigger both creation and update events, depending on checkin policies, and since provisioning of documents are split up in adding the binary document and adding meta data.