xp_fileexist through FTP

  • I am executing a stored procedure on the server that i access through tcp/ip

    I put some text files there though ftp and am loading them in the database:

    BULK INSERT #textfile FROM 'D:\websites\neolane\www\Import\init_tv.txt'

    (this is the path on the server and it worls perfectly well)

    but when i try:

    EXEC xp_fileexist 'D:\websites\neolane\www\Import\init_tv.txt'

    i have that the file is not found!! how come?

  • Can we see the exact code you are using for xp_fileexists?

  • well it's what i already wrote... and i am executing it on the db on the server and i get 0

    declare @result int

    EXEC xp_fileexist 'D:\websites\neolane\www\Import\init_tv.txt' , @result output

    print @result

    however i try it on my local db and on i file on mu c: .... it worked of course...

    Weird how i can import a file while the function says it doesnt exist

  • Probabely because the bulk insert is executed in a different context.  That's the only explenation I can give.  However it's only a hunch and I have no proof to back it up.

     

    Anyone?

  • anyone? any clue??

  • this is what i found:
     
    "I noticed that the behavior of this stored procedure changed between SQL Server 2000 and SQL Server 2005. It appears that in SQL Server 2005 it always returns 0 if executed by a non-sysadmin user regardless of the existence of the file."
     
     
     
    arghhhh stupid no? my user is not a sysadmin!!!

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply