Tuesday, March 9, 2010

GoldMine: Illegal Database

A client asked: When trying to create a new database, we get the error "Failed to create database! Illegal database name or database exists". Tried in both GoldMine and SQL. The database name does not exist so what might be the problem?

There could be a number of reasons. First, check that you do not have an illegal character in the database name (i.e. / ? < > \ : * | ”). Also, some names are reserved under Windows (e.g. com1, lpt1, con, nul, prn). But assuming that the database does not exist and you are not using any illegal characters, then you get the following error in SQL:

SQL error when trying to create new db: SQL Server Error: 5118

This 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. Set the default data directory value and the default log directory value to valid folder paths.

You can set the default data directory value and the default log directory value by using either SQL Server Enterprise Manager or Registry Editor.

Using SQL Server Enterprise Manager

* Click Start, point to Programs, point to Microsoft SQL Server
* Click Enterprise Manager > Right-click the instance of SQL Server
* Click Properties > In SQL Server Properties (Configure)
* Click the Database Settings tab

In the New database default location section, type a valid folder path in the Default data directory box and in the Default log directory box

* Click OK
* Stop your instance of SQL Server, and then restart your instance of SQL Server.

(Note: this also works with SQL Server Management Studio, just go directly to Database Settings from SQL Server Properties).

No comments: