Configure MS SQL server 2005
-
Hi! I have installed MS SQL Server 2005 on my Company's server (c drive) and I want to create my databases so that the Data is on another hard drive (N:\) is is possible to do that. Thank you:~
phokojoe
-
I do not understand. I know how to attach the database. My question is, when you install ms sql server, the default directory is c:\ whatver the name of the hard drive it is. And the .mdf file is located at c:\program files\microsoft sql\mssql\data\databasename.mdf. Now I want this database to be in the other drive not the default drive. Is it possible?
phokojoe
-
I do not understand. I know how to attach the database. My question is, when you install ms sql server, the default directory is c:\ whatver the name of the hard drive it is. And the .mdf file is located at c:\program files\microsoft sql\mssql\data\databasename.mdf. Now I want this database to be in the other drive not the default drive. Is it possible?
phokojoe
" CREATE Database Mydb
ON (Name = mydbdat. FILENAME = 'N:\Mydbdir\mydb.mdf', SIZE = 5MB, MAXSIZE = 10MB FILEGROWTH = 1MB)
Log On (NAME= MydbLog, FILNAME = 'N:\Mydbdir\MyDb.ldf', SIZE =1MB, MAX SIZE = 5MB, FILEGROWTH = 1MB)"TO move an existing database:
"sp_detach_db Mydb;
GO
--Physically move the full-text catalog to the new location.
--Attach the myDbdatabase and specify the new location
CREATE DATABASE Mydb ON
(FILENAME = 'N:\Mydbdir\MyDb.mdf'),
(FILENAME = 'N:\Mydbdir\MyDb.ldf'),
FOR ATTACH;
GO