And for a completely different approach:
Create two stored procedures in the database.
- The one that returns the (custom) full path to the text file file local to the machine on which the database is running.
- One that writes some transferred to text in this file.
In your application:
- a call to a stored procedure that returns a file name
- delete this file on the machine where the executable is running
- a call to a stored procedure that writes a file and passes it a unique text (preferably unique to each call to the stored procedure)
- make sure that you can read the file from a local location and that it contains the text that you sent to the stored procedure.
Just remember to map drives (so check if the drive in the returned file name is a local drive and not mapped) and file names (make sure the machine name matches the name of the local machine).
source share