Posted - 11/01/2005 : 23:05:34
I am facing a problem with permissions while creating a database using script (i am using SQL Express database).
I am excuting a script using following command
osql -E -S <servername>\<instancename> -i <scriptpath> -o <log file name>
It is throwing the below error (copied from log file)
"1> 2> 3> 4> 5> 6> 7> Msg 1802, Level 16, State 4, Server DEV2\SMSPUBTOOL, Line 3
CREATE DATABASE failed. Some file names listed could not be created.
Check related errors.
Msg 5123, Level 16, State 1, Server DEV2\SMSPUBTOOL, Line 3
CREATE FILE encountered operating system error 5(Access is denied.)
while attempting to open or create the physical file 'C:\Program
Files\Microsoft Publishing Tool\DATA\pubDB_Data.MDF'.
1> 2> 3> Msg 15010, Level 16, State 1, Server DEV2\SMSPUBTOOL, Procedure sp_dboption, Line 64
The database 'pubDB' does not exist. Use sp_helpdb to show available
This problem occurs only if i give "program files" path for creating mdf and ldf files.
But i have admin previliges on the machine.
Can some doby suggest me if any other approach for creating database.
Thanks a lot for help
Edited by - kittu_s on 11/02/2005 00:46:20