We have the requirement that a user should be able to write a flat csv file to a fileshare. This file is created in a task-script.
Because of security reasons the xp_cmdshell is turned off for ‘normal’ users. We can’t turn this on from a sql script with the command EXEC sp_configure 'xp_cmdshell', 1;
We had the idea to turn the xp_cmdshell on just before writing the file to the file share and directly after the file has been written we turn the xp_cmdshell off again.
The file is a csv file used for import in a financial system.
What should be an alternative without giving anyone the xp_cmdshell rights in de SQL DB?