Re: CREATE DATABASE, Msg 5105 physical filename may be incorrect e
From: New to the game (Newtothegame_at_discussions.microsoft.com)
Date: 11/27/04
- Next message: Kalen Delaney: "Re: CREATE DATABASE, Msg 5105 physical filename may be incorrect e"
- Previous message: AnthonyThomas: "Re: Relative Performance: Native SQL vs User Functions"
- In reply to: John Bell: "Re: CREATE DATABASE, Msg 5105 physical filename may be incorrect e"
- Next in thread: Kalen Delaney: "Re: CREATE DATABASE, Msg 5105 physical filename may be incorrect e"
- Reply: Kalen Delaney: "Re: CREATE DATABASE, Msg 5105 physical filename may be incorrect e"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 27 Nov 2004 11:51:02 -0800
Thanks all for the thoughts. I discovered script below that attaches the
files (unfortunately, I still receive the same Msg 5105 that started this
thread).
I double-checked the mdf and ldf files and they are not set to read only;
however, the file folder is read-only and will not change. Ideas?
New script:--------------------------
--AttachSampleDB
--Run the script from the master database.
USE master
--Update the paths for the data and log files so they
--are appropriate for your computer.
EXEC sp_attach_db @dbname = N'Chapter02',
@filename1 =
N'C:\SQLVBNET\Chapter_02\Chapter02_dat.mdf',
@filename2 =
N'C:\SQLVBNET\Chapter_02\Chapter02_log.ldf'
"John Bell" wrote:
> Hi
>
> This version of the create database statement would error if the file
> existed, but your error seems to imply
> that the directory does not exist or that your permissions are incorrect.
> Even if the file is read only (which you should change if you copied it from
> CD!) the file existing would give the same error.
>
> Check out sp_attach_db in Books online.
>
> John
>
> "New to the game" <Newtothegame@discussions.microsoft.com> wrote in message
> news:6913EAAA-948D-443B-A034-C7E9BB391575@microsoft.com...
> > Thanks for the reply, John. The code creates a db for each chapter of the
> > book and brings in the data and log files for each chapter. It would seem
> > that the code from the book should run or else I could find lots of
> > compaints
> > around the web. Since I'm new to the game of SQL Server, I wanted to
> > discover what missteps that I am taking. Could you look at the code for
> > me
> > to see if there is any unmentioned setup that I need to do before running
> > this? Here's the chapter 2 sample:
> >
> > --CreateSampleDB
> > --Execute statements from the master database.
> > USE master
> > GO
> >
> > --Drop any prior version of Chapter02 database.
> > IF EXISTS (SELECT *
> > FROM INFORMATION_SCHEMA.SCHEMATA
> > WHERE CATALOG_NAME = N'Chapter02')
> > DROP DATABASE Chapter02
> > GO
> >
> > --Create new version of Chapter02 database.
> > CREATE DATABASE Chapter02
> > ON
> > (NAME = Chapter02_dat,
> > FILENAME = 'C:\SQLVBNET\Chapter_02\Chapter02_dat.mdf',
> > SIZE = 1)
> > LOG ON
> > (NAME = Chapter02_log,
> > FILENAME = 'C:\SQLVBNET\Chapter_02\Chapter02_log.ldf',
> > SIZE = 1,
> > MAXSIZE = 5)
> > GO
> >
> >
> >
> > "John Bell" wrote:
> >
> >> Hi
> >>
> >> It sounds like you should be attaching the files rather than creating
> >> them?
> >>
> >> John
> >>
> >> "New to the game" <Newtothegame@discussions.microsoft.com> wrote in
> >> message
> >> news:41ED1DE0-799F-4C1F-AE80-D87D52616FCB@microsoft.com...
> >> > I'm reading the book "Programming Microsoft SQL Server 2000 with
> >> > Microsoft
> >> > Visual Basic.Net" (quick review on the book: I laughed; I cried; right
> >> > now,
> >> > I'm doing lots of crying.) When I try to create the database required
> >> > for
> >> > exercises, I receive the error:
> >> >
> >> > "Server: Msg 5105, Level 16, State 2, Line 3
> >> > Device activation error. The physical file name
> >> > 'C:\SQLVBNET\Chapter_02\Chapter02_dat.mdf' may be incorrect."
> >> >
> >> > I copied the physical file name location from Windows Explorer so it
> >> > should
> >> > be ok.
> >> > I checked the MSKB for any bugs and worked around all that are listed
> >> > including the default directory malady.
> >> >
> >> > Any ideas on how to install the database?
> >> >
> >>
> >>
> >>
>
>
>
- Next message: Kalen Delaney: "Re: CREATE DATABASE, Msg 5105 physical filename may be incorrect e"
- Previous message: AnthonyThomas: "Re: Relative Performance: Native SQL vs User Functions"
- In reply to: John Bell: "Re: CREATE DATABASE, Msg 5105 physical filename may be incorrect e"
- Next in thread: Kalen Delaney: "Re: CREATE DATABASE, Msg 5105 physical filename may be incorrect e"
- Reply: Kalen Delaney: "Re: CREATE DATABASE, Msg 5105 physical filename may be incorrect e"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|