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
809 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
was a permissions problem
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now