Article ID: 836873 - Last Review: February 20, 2004 - Revision: 1.3 You may receive error messages when you use the CREATE DATABASE statement to create a SQL Server database
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
(http://support.microsoft.com/kb/256986/
)
Description of the Microsoft Windows Registry SYMPTOMSWhen 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 '<database file name>' may be incorrect. Server: Msg 5123, Level 16,
State 1, Line 1 CREATE FILE encountered operating system error 3(The system cannot find the path specified.) while attempting to open or create the physical file '<Full path of the database file name>'. Server: Msg 1802, Level 16, State 1,
Line 1 CREATE DATABASE failed. Some file names listed could not be created. Check previous errors. CAUSEThis problem occurs because the DefaultData and DefaultLog registry values that correspond to the default data directory and to the default log directory exist, but
the folder paths that are mentioned in the registry values are either blank or
do not exist. WORKAROUNDTo work around this problem, use one of the
following methods:
Set the default data directory value and the default log directory value to valid folder pathsYou can set the default data directory value and the default log directory value by using either SQL Server Enterprise Manager or Registry Editor.Use SQL Server Enterprise Manager Note The instance of SQL Server Enterprise Manager that is included with SQL Server 7.0 does not support setting the default data directory and the default log directory. However, you can register your instance of SQL Server 7.0 in the instance of SQL Server Enterprise Manager that is included with SQL Server 2000, and you can then follow these steps to set the default data directory and the default log directory for your instance of SQL Server 7.0.
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. Note The instance of SQL Server Enterprise Manager that is included with SQL Server 7.0 does not support setting the default data directory and the default log directory. However, you can modify the registry values that correspond to the default data directory and the default log directory to work around this problem.
Remove the registry values that correspond to the default data directory and the default log directoryWarning 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.
MORE INFORMATIONWhen 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
(http://support.microsoft.com/kb/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: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL
Server\<Instance Name>\MSSQLServer 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 "Symptoms" section.
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|





















Back to the top