Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Create Database


Create Database

Author
Message
valley3969
valley3969
SSC Rookie
SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)

Group: General Forum Members
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
)
Dugi
Dugi
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1316 Visits: 3511
wow what a chines DB creation ...and the problem is !? w00tHehew00t

============================================================
SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
http://www.sqlservercentral.com/articles/Best+Practices/61537/
valley3969
valley3969
SSC Rookie
SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)

Group: General Forum Members
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?
Steve Jones
Steve Jones
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: Administrators
Points: 36226 Visits: 18751
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
My Blog: www.voiceofthedba.com
JohnG69
JohnG69
Mr or Mrs. 500
Mr or Mrs. 500 (569 reputation)Mr or Mrs. 500 (569 reputation)Mr or Mrs. 500 (569 reputation)Mr or Mrs. 500 (569 reputation)Mr or Mrs. 500 (569 reputation)Mr or Mrs. 500 (569 reputation)Mr or Mrs. 500 (569 reputation)Mr or Mrs. 500 (569 reputation)

Group: General Forum Members
Points: 569 Visits: 452
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!!! Ermm

Can someone explain if this behavior is normal?? I'm suspecting that it's some type of setting on my account... Doze
Tao Klerks
Tao Klerks
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1393 Visits: 1249
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... Doze


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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search