Solved

Write to fileshare

  • 8 April 2020
  • 4 replies
  • 105 views

Userlevel 3
Badge +11

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?

 

icon

Best answer by Frank Wijnhout 9 April 2020, 14:27

View original

4 replies

Userlevel 7
Badge +23

Hey Edwin,

Would the ‘Write file’ connector suffice? You can send the CSV data of the task to the connector, then write it to the location where you would like to have it.

Hope this helps!

Kind regards,
Mark Jongeling

Userlevel 3
Badge +11

I have to figure this out. Sounds if it could work!

Userlevel 7
Badge +23

Forgot to add, there's some documentation on the Write File connector here: https://docs.thinkwisesoftware.com/docs/sf/process_flows.html#write-file-to-disk

I think it can help you :wink:

Hi Edwin,

In general, I would go with Mark's suggestion. But if you really need to write files at (SQL) server side, then there are some specific stored procedures that can help. The following video shows how this works:

 

Reply