please help me with Error 27506 Error executing SQL script

emooofof picture emooofof · Aug 11, 2012 · Viewed 19.8k times · Source

I'm trying to create a setup file using InstallShield 2010 for my project which uses SQL Server 2008

Everything is ok all necessary programs are being installed but when I try to install my project it will give this error

Error 27506. Error executing SQL script dbName.sql Line 9
Create Database failed. some file names listed could not be created Check related errors (1802)

I searched it says that my path in SQL script does not exist but how to make database to be created in installation folder of program itself?

Here first few lines of my SQL script

USE [master]
GO

/****** Object:  Database [InventoryDB]    Script Date: 08/11/2012 19:01:00 ******/
CREATE DATABASE [InventoryDB] ON  PRIMARY 
( NAME = N'InventoryDB', FILENAME = N'C:\Inventory\DB\InventoryDB.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'InventoryDB_log', FILENAME = N'C:\Inventory\DB\InventoryDB_log.ldf' , SIZE = 2816KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

ALTER DATABASE [InventoryDB] SET COMPATIBILITY_LEVEL = 100
GO

please help

Answer

Steve picture Steve · Aug 11, 2012

I think that your setup app should create the path C:\INVENTORY\DB before trying to create the database there.