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
824 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 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