Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 xp_dirtree behaves differently betwn installations

Author  Topic 

bjh
Starting Member

14 Posts

Posted - 2005-05-04 : 07:15:38
Hi,

Before you all tell me that the xp_dirtree stored proc is unsupported and that I can't rely on it and all that so forth - I know!

I'm using xp_dirtree within a stored proc on my test server. My stored proc returns the directory structure of a given path to an ASP page which then rather neatly renders this structure into a Windows Explorer type of view.

I have been able to use this page to display, through a browser, any directory structure for any shared directory on my network (given the right permissions).

Most importantly was the fact that I could simply throw a UNC path to my stored proc and it would throw back the directory structure.

HOWEVER, I cannot get xp_dirtee to work with UNC paths on my live server! It works perfectly for local directories (if I point it at C:\Program Files, for example, all is good). They are both the same versions of SQL Server (2000, SP3) both running on Windows 2000 Server so I can only think that it must be something configured differently.

I'm hoping there must be a simple explanation for this and that one of you lot can supply it!

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-05-04 : 07:34:08
$100 says the live server is running SQL Server under the LocalSystem account. This account has no access to network paths.
Go to Top of Page

bjh
Starting Member

14 Posts

Posted - 2005-05-04 : 07:47:47
You owe me $100!

However, you can keep it because it *was* the reason it wasn't working. I've set up a user for the service to run under, but not set the same permissions as the user the development box runs under.

Thank you very much sir!
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-05-04 : 07:49:12
See what happens when you use undocumented procedures?

(I use some of them all the time)
Go to Top of Page
   

- Advertisement -