SQL File List No Results via Web Page or Execute As
Posted on 2013-09-09
I have a stored procedure that gets data from SQL and also executes xp_dirtree to gather a file list, for linking. This works great when I execute the main stored procedure from SQL Mgmt Studio. However, when I try to execute it from the web page that dumps it into a .xlsx file, it does not give me the file list. (Whereas, the end users can choose the parameters they want for the results.)
1. Again, when I run via SQL it works fine.
2. The parameters being passed from the web page are correct.
3. I have given the domain account that runs SQL 'read' access to the directories and share. (Whereas, I have read this could be the issue)
4. I have tried to 'Execute as' when executing the xp_dirtree. (Doing this fails to give me a file list from within SQL Mgmt Studio)
Any advise would be helpful.