Skip to main content
Solved

Write to fileshare


Forum|alt.badge.img+13

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?

 

Best answer by Frank Wijnhout

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:

https://youtu.be/EhA8skXhsPw

 

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

4 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+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


Forum|alt.badge.img+13
  • Author
  • Sidekick
  • 123 replies
  • April 8, 2020

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


Mark Jongeling
Administrator
Forum|alt.badge.img+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:


Frank Wijnhout
Thinkwise blogger

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:

https://youtu.be/EhA8skXhsPw

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings