April 14, 2006 at 3:39 am
Everyone!
In SQL 2000,there is still "master..xp_fileexist" stored procedure even though it is not documented. And it works that any database user belongs to [public] role.
But in SQL 2005,I log on database user (not sa or sysadmin), I can't find the file. But the file exists. If I use sa(or sysadmin), I can find it.
Why can't it work on normal database user?
Any suggestion?
Thanks for help.
April 14, 2006 at 11:20 am
it is in the sys schema, the call would be master.sys.xp_fileexist. It still has permissions for the public rol to execute.
April 16, 2006 at 7:26 pm
andrew! thanks for your reply!
But my problem is not that I can't find the "xp_fileexist".
My problem is that I can't find the file I want to looking for when I execute xp_fileexist using normal db user logon.
For exeample!
-- Logon as [sa] user
DECLARE @exists INT
DECLARE @FILE_NAME VARCHAR(200)
SET @FILE_NAME='C:\test.txt'
EXEC master..xp_fileexist @FILE_NAME,@exists output
print @exists
---
It shows "1" because 'C:\test.txt' exisits.
But when I logon as normal db user ( not [sa] or [sysadmin])
It returns "0" but 'C:\test.txt' exisits.
Why? @_@
April 17, 2006 at 10:50 am
Stumped me, tried to see definition of xp_fileexist to see what the code was doing security wise, but the sp calls a a dll xpstar90.dll so no go.
June 26, 2006 at 12:25 pm
I wonder if by now somebody has found the solution for this problem... I cna't attach any data file to sql because of this..
Thanks for your postings
LH
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply