Solved

sql server: Directory lookup for the file "C:\sqldata\bdPruebas.mdf" failed with the operating system error 2(The system cannot find the file specified.).

Posted on 2011-02-22
4
815 Views
Last Modified: 2012-08-13
i have this code:
create database demoFilegroups
on primary
(
      name = 'bdPruebas',
      filename = 'C:\sqldata\bdPruebas.mdf',
      size = 3, maxsize=500, filegrowth=2
),
filegroup secondary
(
      name = 'bdPruebas_sec1',
      filename = 'C:\sqldata\bdPruebas_sec1.ndf',
      size = 3, maxsize=500, filegrowth=2
),
(
      name = 'bdPruebas_sec2',
      filename = 'C:\sqldata\bdPruebas_sec2.ndf',
      size = 3, maxsize=500, filegrowth=2
)
log on
(
name = 'bdPruebas_log',
filename = 'C:\sqllog\bdPruebas.ldf',
size = 40, maxsize=500, filegrowth=2
)

i execute
but i have this error

Msg 5133, Level 16, State 1, Line 1

Directory lookup for the file "C:\sqldata\bdPruebas.mdf" 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.

0
Comment
Question by:enrique_aeo
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 34953955
I hate to ask the obvious, but does that folder exist? SQL won't create it on its own, but needs that folder to already exist so it can create files.
0
 

Author Comment

by:enrique_aeo
ID: 34954488
the folder exists. Even copy the path and put it in Start / Run and Windows Explorer showed
0
 
LVL 28

Accepted Solution

by:
Ryan McCauley earned 500 total points
ID: 34954888
Does the SQL Server account have access to that path? Not sure what account the SQL Server service is running as - if it's something like Network Service, though, or a domain user, you'll need to grant read/write access to that path. If it's not able to write files there, it treats it like it doesn't exist.
0
 

Author Closing Comment

by:enrique_aeo
ID: 34954914
was a permissions problem
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question