Strange DB Log file path

  • Strange thing in SQL Server 2000....

    Attaching a database when its log file is not available creates a new log file where the filename path is "strange". A second backslash appears between the folder where the file resides and the log filename. For example, the full path of the log file is "E:\MSSQL80\MSSQL\DATA\\HelloWorld_log.ldf" instead of "E:\MSSQL80\MSSQL\DATA\HelloWorld_log.ldf". Here are the steps to reproduce the problem, assuming that D:\MSSQL80\MSSQL\DATA is the default path for the Data files and "E:\MSSQL80\MSSQL\DATA" is the default path for the Log files

    a) From Enterprise Manager, create a 2MB database called "HelloWorld". Use the default paths and filenenames provided by EM.

    b) From QA, run sp_helpdb 'HelloWorld' to ascertain the database info.

    c) Open a new window in QA and run "sp_detach_db 'HelloWorld'"

    d) From Windows Explorer, rename the database log file

    e) From QA, execute "sp_attach_db 'HelloWorld', 'D:\MSSQL80\MSSQL\Data\HelloWorld_data.mdf'"

    f) we receive this message: "Device activation error. The physical file name 'E:\MSSQL80\MSSQL\Data\HelloWorld_Log.LDF' may be incorrect.

    New log file 'E:\MSSQL80\MSSQL\Data\\HelloWorld_log.LDF' was created."

    Notice the double backslash between "Data" and "Hello_world_log.LDF"

    Will this cause any further problems?

    Please note that this behaviour also occurs in SQL Server 7.0

    Thanks.

  • Not getting the same result:

    Device activation error. The physical file name 'C:\Program Files\Microsoft SQL Server\MSSQL$ONE\data\helloworld_Log.LDF' may be incorrect.

    New log file 'c:\program files\microsoft sql server\mssql$one\data\helloworld_log.LDF' was created.

    Is the file actually getting created? Looks to me like its just a formatting error, its appending an extra slash.

    Andy

    http://qa.sqlservercentral.com/columnists/awarren/

  • Yes, the file gest created in the same directory as the the *.MDF. It is just the content of the message in f) above that annoys me. It is the same path that is filed in the Filepath field of sp_helpdb. Should I be concerned?

Viewing 4 posts - 1 through 3 (of 3 total)

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