Results 1 to 13 of 13
  1. #1
    Join Date
    Jul 2002
    Posts
    229

    Unanswered: Multiple backslashes in physical file name

    Accidentally, I've managed to have this as part of a Create Database:

    ... FILENAME = N'C:\MSSQL\Data\\\testdb_Log.LDF' ...

    , notice the triple backslash. The Create Database statement works fine,
    and sp_helpdb says the log file name is:

    C:\MSSQL\Data\\\testdb_Log.LDF

    I noticed the MSDOS command prompt also allows multiple backslashes,
    they're reduced to one when performing the command and I guess
    SQL Server does the same thing, so no problem so far really.

    But is it supposed to work this way? Quite confusing, isn't it?

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Not sure if it supposed to work that way, but it would get quite confusing after a while. It may even give you "unexpected results" if you detach and try to reattach the files. If you can get away with it, I would heartily suggest getting the files renamed.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    This sounds like a question for Old Man Phelan.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    It gets better... This actually goes back to the Unix days, and has to do with how pathing is logically based. Just for jolly factors, try to explain the difference between:
    Code:
    dir c:\windows\\system32
    dir c:\\windows\system32
    Why does one work, and one fail? What causes the time lag? What did you really do?

    Answers will follow, but I'd love to hear folks try to talk this fiasco out a bit first.

    -PatP

  5. #5
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Hmnmm...I got a network path not found message from the second one. I am going to guess that the system is interpreting this as "Using the protocol 'C', go to the machine called 'Windows', and get the file called 'System32'". The delay is caused by waiting for all of the DNS servers to chime in saying "Nope. No server called 'Windows' here." Still no idea why the first example works, though.

  6. #6
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Hello Pat I can proof both of your lines correct

    check this
    for
    dir c:\windows\\system32
    Code:
    c:\windows\ md (alt+092)system32
    dir c:\\windows\system32
    Code:
    c:\md (alt+092)windows
    Now both are valid folders and path too...
    Put your Numlock on and type numbers from there
    Last edited by rudra; 10-02-06 at 15:06.
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  7. #7
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by MCrowley
    Hmnmm...I got a network path not found message from the second one. I am going to guess that the system is interpreting this as "Using the protocol 'C', go to the machine called 'Windows', and get the file called 'System32'". The delay is caused by waiting for all of the DNS servers to chime in saying "Nope. No server called 'Windows' here." Still no idea why the first example works, though.
    Bingo! Full marks for that half of the problem!

    Now to give a few more clues on the first half of the problem...

    Code:
    dir c:\windows\system32\.\
    dir c:\windows\system32\..\
    dir c:\windows\system32\..\.\
    dir c:\windows\system32\..\..\
    What do "dot" and "double dot" refer to? Based on that answer, why is an empty reference logically the same as a "dot" reference?

    NOTE: If you have only worked with Microsoft Operating Systems, you are at a sore disadvantage here. This is another clue.

    -PatP

  8. #8
    Join Date
    Jul 2002
    Posts
    229
    Quote Originally Posted by MCrowley
    It may even give you "unexpected results" if you detach and try to reattach the files. If you can get away with it, I would heartily suggest getting the files renamed.
    That's how I noticed it, I was trying to attach a database
    file when I got an error message because the referred Log file didn't exist. Then I happened
    to notice the double backslash in the Log file name. This wasn't the cause of the error though, the file
    was simply missing. But, no idea how the double backslash got there!

  9. #9
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by Coolberg
    But, no idea how the double backslash got there!
    My first guess would be a typo (fat fingers, flying furiously, flubbing fiendishly). My next guess would be a keyboard problem (key bounce). Next would be a numeric directory name typed with Num Lock turned off... After that, I'd give up!

    -PatP

  10. #10
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    Quote Originally Posted by Pat Phelan
    Bingo! Full marks for that half of the problem!

    Now to give a few more clues on the first half of the problem...

    Code:
    dir c:\windows\system32\.\
    dir c:\windows\system32\..\
    dir c:\windows\system32\..\.\
    dir c:\windows\system32\..\..\
    What do "dot" and "double dot" refer to? Based on that answer, why is an empty reference logically the same as a "dot" reference?

    NOTE: If you have only worked with Microsoft Operating Systems, you are at a sore disadvantage here. This is another clue.

    -PatP
    . refers to the current directory you are in (i.e. c:\windows\system32\.\ is the c:\windows\system32 directory.)

    .. refers to the parent directory of the one you are in (i.e c:\windows\system32\.. refers to c:\windows directory.)

    so the ..\..\ would put you at the c:\WINDOWS folder.
    [EDIT ... I typed too fast] ... ..\..\ puts you at the root of the C drive!
    Last edited by tomh53; 10-02-06 at 16:46.

    -- This is all just a Figment of my Imagination --

  11. #11
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Hmm. I am still a touch confused about the empty reference. When you type in
    Code:
    dir \
    or
    Code:
    cd \
    You end up referring to the root of the current drive. dir \\ gives you
    Code:
    C:\Documents and Settings\mcrowley>dir \\
    The filename, directory name, or volume label syntax is incorrect.
    Hmm...It may be time to dust off the Linux test machine....

  12. #12
    Join Date
    Jul 2002
    Posts
    229
    \\ on some systems means referring to a network
    computer.

  13. #13
    Join Date
    Jul 2002
    Posts
    229
    Quote Originally Posted by Pat Phelan
    My first guess ...
    It's a SP who makes up the filename I think.
    I'll have to trace myself through the code. Funny it
    hasn't occurred when we've been using the same SP
    before.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •