PDA

View Full Version : Can anyone help with SQL SERVER 2000 Question



cwdlmdd
10-23-2007, 12:11 AM
I have copied this small bit of code right out of the Microsoft book. That should execute in the SQL Query Analyzer but it wont.

Which you would think that it would work just fine! But it doesn't. And I can not see where the problems is. I am hoping that someone can help me. I have compared it with the book quite a few times and it looks to same to me.

Here is the code and the error message that I am getting. Is the code case sensitive like it is in some of the other programming?

I can not see where the problem is!

USE master
GO
CREATE DATABASE BookShopDB
ON PRIMARY
(
NAME = Bookshop_dat,
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\Bookshop.mdf',
SIZE = 4,
MAXSIZE = 10,
FILEGROWTH = 1)
LOG ON
(
NAME = Bookshop_log,
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\Bookshop.ldf',
SIZE = 2,
MAXSIZE = 5,
FILEGROWTH = 1)
GO


Server: Msg 5123, Level 16, State 1, Line 1
CREATE FILE encountered operating system error 3(The system cannot find the path specified.) while attempting to open or create the physical file 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\BookShop.mdf'.
Server: Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check previous errors.
The CREATE DATABASE process is allocating 4.00 MB on disk 'BookShop_dat'.
The CREATE DATABASE process is allocating 2.00 MB on disk 'BookShop_log'.

Fumigator
10-23-2007, 12:42 AM
(The system cannot find the path specified.) while attempting to open or create the physical file 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\BookShop.mdf'.

Did you notice this part?

cwdlmdd
10-23-2007, 03:06 AM
Yes I did. And I have checked the path to be sure that the spelling and everything is correct.

Is there something is that I should have done first before creating this or executing it?

I have followed the instruction line by line in the books and compared them to what I have more then once.

I am just getting started with this and this is the first problem that I have had so far. And I am just not sure what to do to solve the problem.

Roelf
10-23-2007, 11:15 AM
is the file there? is it already in use with sql server?

cwdlmdd
10-23-2007, 10:01 PM
No it is not. From what I read in the book the code should create the file for me and place those files in it.