Microsoft KB Archive/836873

= You may receive error messages when you use the CREATE DATABASE statement to create a SQL Server database =

Article ID: 836873

Article Last Modified on 2/20/2004

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition
 * Microsoft SQL Server 7.0 Standard Edition

-



Important This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SYMPTOMS
When you try to create a Microsoft SQL Server database by running the CREATE DATABASE Transact-SQL statement, you may not be able to create the database, and you may receive the following error messages:

Server: Msg 5105, Level 16, State 2, Line 1

Device activation error. The physical file name '

In Registry Editor, select the following registry key for a named instance of SQL Server:

 In the right pane, right-click the DefaultData registry value, and then click Modify. In the Edit String dialog box, type the valid folder path in the Value data box, and then click OK. Repeat step 4 and step 5 for the DefaultLog registry value. Stop your instance of SQL Server, and then restart your instance of SQL Server.

Remove the registry values that correspond to the default data directory and the default log directory
Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.  Click Start, and then click Run. In the Run dialog box, type Regedit in the Open box, and then click OK.</li> In Registry Editor, locate and select the following registry key for a default instance of SQL Server:

In Registry Editor, locate and select the following registry key for a named instance of SQL Server:

</li> In the right pane, delete the DefaultData registry value and the DefaultLog registry value.</li> Stop your instance of SQL Server, and then restart your instance of SQL Server.</li></ol>

<div class="moreinformation_section">

MORE INFORMATION
When you set up an instance of SQL Server, the Setup program does not create the registry entries that correspond to the default data directory and the default log directory. Therefore, when you view the New database default location section in SQL Server Enterprise Manager, the paths for Default data directory and Default log directory are blank.

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

272705 Default data and log directory display blank by default after you install SQL Server 2000

However, when you set the default data directory and the default log directory for the first time, the corresponding DefaultData and DefaultLog registry values are created in the following registry key for a default instance of SQL Server:

The DefaultData and DefaultLog registry values are created in the following registry key for a named instance of SQL Server:

The DefaultData registry value contains the folder path that is set for the default data directory. Similarly, the DefaultLog registry value contains the folder path that is set for the default log directory.

When you create a new database by using the CREATE DATABASE Transact-SQL statement, SQL Server tries to create the data file and the log file that correspond to the database in the folders that are specified in the DefaultData registry value and in the DefaultLog registry value. Therefore, if the DefaultData registry value and the DefaultLog registry value contain folder paths that do not exist, SQL Server cannot create the corresponding data file or log file for the database successfully, and you receive the error messages that are mentioned in the &quot;Symptoms&quot; section.

Additional query words: creation fails cannot can't incorrect filename

Keywords: kberrmsg kbregistry kbtsql kbdatabase kbfile kbprb kbupdate KB836873

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.