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 ««12345»»»

Create Database Expand / Collapse
Author
Message
Posted Monday, May 11, 2009 5:31 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 5:21 AM
Points: 1,722, Visits: 470
This question is very badly implemented. I knew it couldn't create a database on my system because it made too many assumptions:

1. Can I write to the root directory of my primary disc drive?
2. Do the absolute paths given for the file locations exist?

To the moderators of SQLServerCentral I repeat what I have said before: "Please ensure that questions posed can be answered based on knowledge of the question subject matter and that they are not affected unduly by local configurations.:

Kenneth Spencer
Post #713990
Posted Monday, May 11, 2009 5:51 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, May 8, 2013 9:15 AM
Points: 509, Visits: 61
My MSSQL doesn't have permissions outside of "C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data". Therefore if you gave someone this script to run it could possibly fail on someone if they haven't modified permissions. So the answer is "YES," it will work to modify the extensions, but it is contingent upon other factors. This question is a little misleading for that reason.

***************
wnylibrarian
Buffalo, NY US
Post #714002
Posted Monday, May 11, 2009 5:54 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, November 1, 2010 3:34 AM
Points: 33, Visits: 39
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\mssql\MYTEST.doc" failed with the operating system error 2(error not found).
Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.


Me too.
Post #714003
Posted Monday, May 11, 2009 7:12 AM
SSC-Addicted

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

Group: General Forum Members
Last Login: Thursday, June 19, 2014 7:18 AM
Points: 465, Visits: 60
Simply given the infomation stated, answer is "no".

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.
Post #714072
Posted Monday, May 11, 2009 7:14 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, November 29, 2010 7:15 AM
Points: 331, Visits: 62
I would rephrase the question:
is it possible to create a DB with this code?

The way you put the the question is tricky!
Post #714077
Posted Monday, May 11, 2009 7:23 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 9:04 AM
Points: 1,623, Visits: 357
Ditto and...
Ditto to the edit, as well.
Post #714090
Posted Monday, May 11, 2009 7:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 18, 2014 12:46 AM
Points: 2, Visits: 86
Running the risk of sounding like a smartar.. Your example is as bad as the 'tested' code I get from my users. You know SQL server can create files but not directories. Nice point though regarding mdf, ldf, ndf

perhaps include:

exec xp_cmdshell 'MD c:\mssql'
go

cheers
Post #714123
Posted Monday, May 11, 2009 8:05 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 3:10 PM
Points: 2,607, Visits: 17,912
I agree that it is difficult to test when part of the question depends on the environment and configuration. I did think it was pretty easy to tell what the question was trying to point out though. I never thought of putting an .mp3 extension on my database - gave me quite a chuckle!
Post #714140
Posted Monday, May 11, 2009 8:16 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, December 5, 2013 3:37 AM
Points: 68, Visits: 29
Syntax incorrect on 2005
Post #714158
Posted Monday, May 11, 2009 8:21 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:53 AM
Points: 1,176, Visits: 778
DOH!

A wee bit vague... I guess ultimately it caught me out since i made assumptions as to the permissions for SQL Server access to the stated directory...
Post #714162
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse