Monday, February 13, 2012

Attaching a DB to a Network Folder

I'm trying to attach a db to a network folder.

I used the sproc sp_attach_db from master db to attach a test db to a local drive (c:\test) and works fine.

EXEC sp_attach_db @.dbname = N'myDatabase',
@.filename1 = N'C:\Test\myDatabase.mdf'

NO PROB. With this--

but when i try to attach a test td to a network drive, (\\computer\test) does not work.

EXEC sp_attach_db @.dbname = N'myDatabase',
@.filename1 = N'\\computer\test\myDatabase.mdf'

--I get this error message -

File '\\computer\test\myDatabase.mdf' is on a network device not supported for database files.

So i'm thinking that I can not use sp_attach_db sproc to attach a db to a network drive?

Is there any other way to attach a db to a network drive?

I even tried to map the network folder and it did not work.

EXEC sp_attach_db @.dbname = N'myDatabase',
@.filename1 = N'z:\test\myDatabase.mdf'

Yeah i forgot to tell you I'm using SQL Server 2000.
If you have ever run into this kind of situation, please let me know.

Thanks.

Irv

This link may help

http://support.microsoft.com/default.aspx?scid=kb;en-us;304261

specifically the use of trace flag 1807

|||You could try adding trace flag 1807
Allows you to configure SQL Server with network-based database files.

Note: I would not do this with a database myself because I don't know the down side.

See thread http://forums.databasejournal.com/showthread.php?t=30580&goto=nextnewest

Tim S

|||

Thanks Guys, That was really helpful!

Irv

No comments:

Post a Comment