Wednesday, March 28, 2012

How to change standard saving folder?

Hello,

My english is not the best, but i will try my best.

I want to change the saving folder for the database from my systempartition to my datapartition (from c:\blabla to d:\mydata), but i dont know how. I can see the folder but it is in gray font and unchangeable in the server configuration tool.

Greetings Thomas

Hi Thomas,

Try detach and attach your database in new location.

Use the following:

EXEC sp_detach_db 'DBNAME'

After copy your DBFiles for new location:

Syntax:

EXEC sp_attach_db @.dbname = N'pubs',

@.filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf',

@.filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf' Good Luck!Regards,

|||

To change the default database locations (for ALL future databases)

right-click on Server Name (in Object Explorer) -> Properties -> Database Settings

you'll see 2 lines under "Database default locations"

Data: PATH_NAME

Log: PATH_NAME

hope this helps

|||

Hi Jerry,

That is exactly what i was looking for, thank you very much.

Thomas

|||

I have searched for this, too. Thanks.

I have one question to add here: When browsing through the filesystem using (SQL 2005 enterpr.) I can only browse two levels within the filesystem. For example I can only go until e:\mssql\mssql but not deeper.

Can someone tell me what to do, so that I can browse into deeper folders?

No comments:

Post a Comment