|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, July 10, 2009 2:05 AM
Points: 29,
Visits: 12
|
|
得行的哈
我又自己做了哈测试的
create database test
--创建主库 on primary ( --数据库逻辑名 name='test _lj',
--数据库路径 filename='D:\Develop_Files\Database\ test.mp3',
--数据库初始大小 size=3MB,
--数据库最大容量 Maxsize=10MB,
--增长幅度 filegrowth=1MB
)
--创建日志文件 log on ( --数据库日志名 name=' test _log',
--数据库日志路径 filename='D:\Develop_Files\Database\ test.doc',
--日志文件初始大小 size=3MB, --日志文件最大容量 Maxsize=10MB,
--增长幅度 filegrowth=1MB )
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, April 02, 2013 1:48 AM
Points: 1,252,
Visits: 3,367
|
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, July 10, 2009 2:05 AM
Points: 29,
Visits: 12
|
|
谢了哈,黄毛。你看来是论坛的元老级了哈,有问题问你哈,以后。
Thanks,man. It seems that you r a senior in the forum. if I have any qus. in the future, ask you OK?
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Today @ 11:20 AM
Points: 31,437,
Visits: 13,752
|
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Friday, November 09, 2012 12:51 AM
Points: 429,
Visits: 187
|
|
I have a question... I've changed the script to use C:\ for both files as follows:
Create Database Mytestdb on ( name ='Mytest_1', Filename= 'C:\MyTEST.mp3', size = 2000 KB )log on( name ='MyTest_2', Filename= 'C:\MYTEST.doc', size= 512 kb)
and get the following error:
Msg 5123, Level 16, State 1, Line 1 CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\MyTEST.mp3'. Msg 1802, Level 16, State 4, Line 1 CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
I am administrator of my machine and the DB is installed locally and I'm sysadmin....
When I change the files to C:\temp\filenames... (with temp folder being existant)... it works!!! 
Can someone explain if this behavior is normal?? I'm suspecting that it's some type of setting on my account...
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Sunday, April 14, 2013 8:55 AM
Points: 1,383,
Visits: 1,212
|
|
jghali (6/4/2010)
... Create Database Mytestdb on ( name ='Mytest_1', Filename= 'C:\MyTEST.mp3', size = 2000 KB )log on( name ='MyTest_2', Filename= 'C:\MYTEST.doc', size= 512 kb) ... CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\MyTEST.mp3'. ... Can someone explain if this behavior is normal?? I'm suspecting that it's some type of setting on my account... 
The permissions required are for the account that SQL Server is running under, not your account.
To see what account that is, open the services panel (services.msc) for example, and find the MSSQL Service.
http://poorsql.com for T-SQL formatting: free as in speech, free as in beer, free to run in SSMS or on your version control server - free however you want it.
|
|
|
|