Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by vinaykumar
»
Create Database
56 posts, Page 5 of 6
««
«
2
3
4
5
6
»»
Create Database
Rate Topic
Display Mode
Topic Options
Author
Message
Toreador
Toreador
Posted Wednesday, May 13, 2009 8:52 AM
Ten Centuries
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:52 AM
Points: 1,356,
Visits: 4,761
Lynn Pettis (5/13/2009)
If you take a few minutes to read CREATE DATABASE in BOL you'd see that it is required that the directory structure already be in place, therefore for this question it must be assumed that requirement was already met. Based on that, the statement works.
Wouldn't an equally valid assumption be that the requirement was not already met (as the path does not exist in a standard installation), and hence that the statement does not work?
Anyway, I'll quit whining as I'm too ignorant to think up any questions of my own
Post #716076
Rachel Byford
Rachel Byford
Posted Wednesday, May 13, 2009 8:53 AM
SSCommitted
Group: General Forum Members
Last Login: 2 days ago @ 9:27 AM
Points: 1,538,
Visits: 802
I don't dare submit a question - I'd hate to be on the receiving end of all these complaints!
And besides, the only questions I can think of are ones to which I don't yet know the answer...
I repeat from a post on a previous thread though - I love SSC.
Post #716077
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Wednesday, May 13, 2009 8:59 AM
SSC-Dedicated
Group: Administrators
Last Login: Today @ 1:14 AM
Points: 31,433,
Visits: 13,746
The requirement for the path to exist could be a question. That's certainly valid, but this question asked "will this work" (originally) and then "can this work" (edited). In either case, given the right situation, it will (and can).
It's a simple yes/no, so you would lean yes. If it can never work, as in
CREATE DATABASE MyDB on SAN="\\mysan\mymount"
Then you would lean no.
Feel free to try a question. they don't automatically go out. I look over them and will send them back if they're too vague. So definitely I make mistakes on some of these as well.
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #716083
John.Sansom
John.Sansom
Posted Wednesday, May 13, 2009 9:27 AM
Old Hand
Group: General Forum Members
Last Login: Yesterday @ 10:23 AM
Points: 343,
Visits: 1,456
Lynn Pettis (5/13/2009)
John Sansom (5/13/2009)
Hi,
This of course does not work, unless the folder structures are in place on the system in question. Otherwise errors of the form below are returned.
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\mssql\MYTEST.doc" failed with the operating system error 2(The system cannot find the file specified.).
Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Yep, as several others have already mentioned. If you take a few minutes to read CREATE DATABASE in BOL you'd see that it is required that the directory structure already be in place, therefore for this question it must be assumed that requirement was already met. Based on that, the statement works.
I did actually attempt to remove the post almost immediately after posting it, having only subsequently then noticed the prior pages comments, so yes my mistake.
For some reason though, I am unable to remove the post.
John Sansom (
@sqlBrit
) |
www.sqlbrit.com
The SQLBrit Community Forum
- "There's so more to being a Data Professional than just technology."
Post #716123
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Wednesday, May 13, 2009 10:25 AM
SSC-Dedicated
Group: Administrators
Last Login: Today @ 1:14 AM
Points: 31,433,
Visits: 13,746
We don't allow post deletions. We do allow editing.
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #716174
John.Sansom
John.Sansom
Posted Wednesday, May 13, 2009 10:29 AM
Old Hand
Group: General Forum Members
Last Login: Yesterday @ 10:23 AM
Points: 343,
Visits: 1,456
Steve Jones - Editor (5/13/2009)
We don't allow post deletions. We do allow editing.
duly noted, thanks.
John Sansom (
@sqlBrit
) |
www.sqlbrit.com
The SQLBrit Community Forum
- "There's so more to being a Data Professional than just technology."
Post #716179
brewmanz
brewmanz
Posted Wednesday, May 13, 2009 2:46 PM
SSC-Addicted
Group: General Forum Members
Last Login: Tuesday, December 04, 2012 11:16 AM
Points: 477,
Visits: 389
I'm surprised that this is treated as a T-SQL issue rather than Administration, as I regard database space creation as Admin.
To me, T-SQL stands for 'Transaction(al) SQL', and I don't see much in the way of transactions for space creation. Or is this something that people do in transactions & then roll back?
Post #716446
Dugi
Dugi
Posted Wednesday, May 20, 2009 3:13 AM
Ten Centuries
Group: General Forum Members
Last Login: Tuesday, April 02, 2013 1:48 AM
Points: 1,252,
Visits: 3,367
Yep I said No, but if you think little bit more about creating DB details, you will said yes...the default for data file was mdf, ndf and for log files was ldf...but you can put any format doc, pdf, mp3 sure that it is not preferable couz you can confuse yourself with the files. On the other hand it is very tricky - security thing!
============================================================
SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #720398
Brian Ferguson
Brian Ferguson
Posted Wednesday, June 10, 2009 1:58 PM
Ten Centuries
Group: General Forum Members
Last Login: Thursday, November 01, 2012 9:47 AM
Points: 1,043,
Visits: 102
Code as indicated does not work for me either.
By adding a c:\mssql folder (did not have one on my system) AND changing the the data file folder to c:\mssql, it works.
Create Database Mytestdb
on
(
name ='Mytest_1',
Filename= 'C:\mssql\MyTEST.mp3',
size = 5000 KB
)
log on
(
name ='MyTest_2',
Filename= 'C:\mssql\MYTEST.doc',
size= 512 kb
)
But the code as written in the question will not work.
Post #732596
Lynn Pettis
Lynn Pettis
Posted Wednesday, June 10, 2009 2:31 PM
SSC-Insane
Group: General Forum Members
Last Login: Yesterday @ 11:07 PM
Points: 21,625,
Visits: 27,468
Brian Ferguson (6/10/2009)
Code as indicated does not work for me either.
By adding a c:\mssql folder (did not have one on my system) AND changing the the data file folder to c:\mssql, it works.
Create Database Mytestdb
on
(
name ='Mytest_1',
Filename= 'C:\mssql\MyTEST.mp3',
size = 5000 KB
)
log on
(
name ='MyTest_2',
Filename= 'C:\mssql\MYTEST.doc',
size= 512 kb
)
But the code as written in the question will not work.
If you read BOL, you will see that for CREATE DATABASE, the directory structure must already exist. Therefor, if you are going to run this code, you should have already ensured that the directory structure you are using in the CREATE DATABASE statement already exists. Based on that, the code works. Regardless if the code failed on your system when you attempted to run it.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #732610
« Prev Topic
|
Next Topic »
56 posts, Page 5 of 6
««
«
2
3
4
5
6
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.