Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
898 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 2000 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

609 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