Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««23456

Create Database Expand / Collapse
Author
Message
Posted Friday, June 12, 2009 12:14 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC 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
)
Post #733532
Posted Friday, June 12, 2009 12:25 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, July 18, 2014 2:25 AM
Points: 1,262, Visits: 3,419
wow what a chines DB creation ...and the problem is !?

============================================================
SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #733535
Posted Sunday, June 14, 2009 11:22 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC 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?
Post #734795
Posted Monday, June 15, 2009 7:54 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 2:28 PM
Points: 33,062, Visits: 15,174
Please post questions in the appropriate forum. This forum is for author comments. Moving to 2005-admin.

If you have questions, just post in a forum, someone will see it and try to answer.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #735019
Posted Friday, June 4, 2010 9:45 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, April 11, 2014 8:16 AM
Points: 434, Visits: 202
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...
Post #932905
Posted Friday, June 4, 2010 10:01 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, April 25, 2014 10:35 AM
Points: 1,385, Visits: 1,241
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.
Post #932921
« Prev Topic | Next Topic »

Add to briefcase «««23456

Permissions Expand / Collapse