I'm trying to execute the following script in SQL Server Management Studio but I'm getting the error:
Msg 5123, Level 16, State 1, Line 2
CREATE FILE encountered operating system error 5 (Access is denied.) while attempting to open or create the physical file 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\test1.mdf'.
Msg 1802, Level 16, State 4, Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Script :
USE [master]
GO
/****** Object: Database [bioenergiasIpad] Script Date: 08/07/2012 17:01:19 ******/
CREATE DATABASE [test1] ON PRIMARY
( NAME = N'test1',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\test1.mdf',
SIZE = 70656KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB)
LOG ON
( NAME = N'test1_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\test1_log.ldf',
SIZE = 164672KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
Already have all role permissions for my user, any ideas on what's wrong ?
Thanks !


CREATE DATABASE [test1]; GO? – swasheck Aug 9 '12 at 21:03