SQL Server Performance

Win2003 problem?

Discussion in 'General DBA Questions' started by CanadaDBA, Mar 16, 2005.

  1. CanadaDBA New Member

    One of my stored procedures writes a log text file into Log folder on my server. I tested it in my local computer (Win2000 Pro) and also in our Dev Server (Win2000 Server) and it works without any error. But it doesn't work on our Test server (Win2003).

    Here is what I did:
    1. Mapped a drive on the server's consol, i.e. MAP S: E:Shared
    2. From a TS session I can "see" the S: drive and write or create in it.
    3. Run the following code in QA (I am using sysadmin user id to connect QA):



    DECLARE @CommandStr VarChar(8000), @FileName VarChar(20)

    SET @FileName = 'S:Test'

    SET @CommandStr = 'Echo This is a TEST! >> ' + @FileName

    exec master..xp_cmdshell @CommandStr
    GO


    It says "Path not found" which is the S: . There should be something wrong with Win2003. Have you had any experience on this issue?


    CanadaDBA
  2. Adriaan New Member

    Shouldn't you specify a complete file name instead of just the path to the folder?
  3. CanadaDBA New Member

    It's not only the path. S: is the path and Test is the file name. Although I can put Text.txt as file name but it doesn't affect the result.

    quote:Originally posted by Adriaan

    Shouldn't you specify a complete file name instead of just the path to the folder?

    CanadaDBA
  4. satya Moderator

    Why not specify the UNC name instead of drive letter, like \servernamepathsharenamefilename.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  5. CanadaDBA New Member

    Actually the target was to use UNC and now it is working with UNC path. But I was just curios why the mapping is working in Win2000 and doesn't work in Win2k3.


    CanadaDBA
  6. satya Moderator

    I beleive it is because some of the security changes recently and compared to Win2k and 2k3 authentication of mapping drives, in general it is suggested to use UNC wherever necessary.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.

Share This Page