Showing posts with label path. Show all posts
Showing posts with label path. Show all posts

Saturday, February 25, 2012

Creating a database on a network path

When I try to create a new database on a network path, I get the following error:

"\\server\test\testdatabase.mdf" is on a network path that is not supported for database files.

Am I trying something that isn't possible? Should databases always be stored on the server PC running SQL (Express)?
I'm using Visual Basic Express and SQL Express (installed on a local PC not the server, so the connectionstring is ".\SQLEXPRESS"), TCP/IP is enabled.

Regards, EBAMore about storage in network path in SQL Server can be found here:

http://support.microsoft.com/kb/304261/en-us

Generally spoken, this is not supported.

HTH, Jens Suessmeyer.

http://www.slqserver2005.de|||Jens, thanks very much for your help. It would have taken me quite some time to find this answer. I guess I'll abandon this idea.

Regards, EBA|||

WOW, I am impressed!

Friday, February 17, 2012

CREATEing a new db

I am trying to create a new database with T SQL in the query window.

I am working from a book and have doubled checked my spelling, path, and all other things that seem obvious. There is something I am missing. I get an error message when I run my script.

Here is my script.....

ON

(NAME = 'Accounting',

FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\

Data\AccountingData.mdf',

SIZE = 10,

MAXSIZE = 50,

FILEGROWTH = 5)

LOG ON

(NAME = 'AccountingLog',

FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\

Data\AccountingLog.ldf',

SIZE = 5MB,

MAXSIZE = 25MB,

FILEGROWTH = 5MB)

GO

This is the error that I got...

Msg 5133, Level 16, State 1, Line 1

Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL Data\AccountingData.mdf" failed with the operating system error 123(The filename, directory name, or volume label syntax is incorrect.).

Msg 1802, Level 16, State 1, Line 1

CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

I am running SQL Server 2005 Express. Please help.

Thanks,

stuck

It appears that your path is incorrect. (Though NOT your fault.)

There is an issue with ending a line with a backslash. It is ignored.

Note the path in the error message. There is NOT a backslash between MSSQL and Data.

It probably should be '"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AccountingData.mdf"

Don't break the line like on the backslash.

Code Snippet


CREATE DATABASE AccountingData
ON ( NAME = 'Accounting',
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AccountingData.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5
)
LOG ON ( NAME = 'AccountingLog',
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AccountingLog.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB
)

GO