|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 4:45 AM
Points: 1,418,
Visits: 266
|
|
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
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Wednesday, May 08, 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
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, November 01, 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.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, January 09, 2013 10:00 AM
Points: 331,
Visits: 54
|
|
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.
|
|
|
|
|
Old 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!
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, April 30, 2013 6:32 AM
Points: 1,592,
Visits: 352
|
|
Ditto and... Ditto to the edit, as well.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, November 09, 2012 6:06 AM
Points: 2,
Visits: 63
|
|
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
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 1:31 PM
Points: 2,558,
Visits: 17,421
|
|
| 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!
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, July 29, 2011 4:38 AM
Points: 68,
Visits: 28
|
|
|
|
|
|
Ten 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...
|
|
|
|