Author |
Topic |
Nazri
Starting Member
8 Posts |
Posted - 2007-05-01 : 02:15:45
|
Hi,In my system, for creating a databae the default path is in C:\ drive, but iwant to change into D:\ drive as a default path.Please tell me how to change?? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-01 : 02:18:27
|
Enterprise Manager - right click on the Server - property - Database settings - Default Data / Log Direcotry KH |
 |
|
Nazri
Starting Member
8 Posts |
Posted - 2007-05-01 : 02:28:46
|
i am using sql server 2005, you mean that after creating the database i can change the path, but i want ,before creating a database can i change the default path.??? then whenever i create a database i automatically should created in D:\ drive(after changig default path) quote: Originally posted by Nazri Hi,In my system, for creating a databae the default path is in C:\ drive, but iwant to change into D:\ drive as a default path.Please tell me how to change??
|
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-01 : 02:33:45
|
"before creating a database can i change the default path"YESSQL Server Management Studio - right click on the Server - property - Database settings - Database default location KH |
 |
|
Nazri
Starting Member
8 Posts |
Posted - 2007-05-01 : 02:39:53
|
Than u very much khtan...quote: Originally posted by khtan "before creating a database can i change the default path"YESSQL Server Management Studio - right click on the Server - property - Database settings - Database default location KH
|
 |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2008-12-12 : 06:32:40
|
Is it possible to make this change programatically? i.e how can you change the default Data and default Log files via a script solution?Jack Vamvas--------------------http://www.ITjobfeed.com |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-12-12 : 10:47:09
|
Yes you can.USE [master]GO--Data fileEXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultData', REG_SZ, N'Location'GO-- Log fileEXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultLog', REG_SZ, N'Location'GO |
 |
|
gvphubli
Yak Posting Veteran
54 Posts |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
|
Jason100
Starting Member
34 Posts |
Posted - 2008-12-18 : 22:23:06
|
if you have created a database , you can 1.0 stop you sql server 2.0 copy the database .mdf and .log to you will store drive3.0 drop the old database 4.0 Attach the database |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-12-18 : 23:17:09
|
quote: Originally posted by Jason100 if you have created a database , you can 1.0 stop you sql server 2.0 copy the database .mdf and .log to you will store drive3.0 drop the old database 4.0 Attach the database
. Bad suggestion. Why stop SQL Server? You can just use ALTER Database Modify.. |
 |
|
|