PDA

View Full Version : CREATE DATABASE failed



DotNetShannon
03-04-2008, 09:16 PM
A couple of my customers are receiving the following error:

"Error 27552. Error creating database NetStudio. Server: Microsoft SQL Server (local)\SQLEXPRESS. CREATE DATABASE failed. Some filenames listed couldnot be created. Check related errors. (1802)."

This appears to be related to another post: http://community.installshield.com/showthread.php?t=177923

However, in my installer I'm using the Create Catalog if Absent option on my SQL connection to create my database. Is this a known bug with this option and will I need to create my own script to create the database?

Bloopy
03-18-2008, 03:45 PM
I just ran into this and the root cause was that the .ldf and .mdf it was trying to create already existed, because an earlier copy of the database had been renamed in the SQL IDE, which does not rename ldf/mdf on file level:

- Create db named db_name, db_name_log.ldf and db_name.mdf get created in SQL's data folder
- Rename db in SQL 2005 Management Studio, file names do not change
- Profiler shows IS runs a query like:

select name from master.dbo.sysdatabases where name = 'db_name'
which fails because that name no longer exists in sysdatabases
- FileMon showed that sqlserver was querying for


C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\db_name_log.ldf

and


C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\db_name.mdf
- IS setup displays Error 27552...(1802)

My 'fix' was to delete those orig databases.

- Bloopy