How do I 'mount' a SQL DB

Hi, I've just completed a SQL 2005 installation, and I need to remove any databases that are not going to get used (like model?), and additionally 'mount' a databases that is stored on another drive..

How can I achieve this ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Oooh, kinky :)
The model is considered a "system database" and should not be removed.   You might have some demo databases (Pubs, Northwind, etc) that you can safely remove.
The method to move database files (the *.mdf and *.ldf files) is by doing an Attach operation.  This can be easily done via the SQL Management Studio... just right click on databases, actions, attach.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
master, model, msdb and tempdb are system databases and you shouldnt remove them...
by the way you can add an existing database by using sp_attach_db procedure or by using aterprise manager...
right click on the databases entry and choose attach ...
in the window opened choose the db files form file system and press OK...
thats all
j4jackAuthor Commented:
OOPS ! Bit of a problem... I originally on Machine 'A' went into SQL, right clicked on the database, then choose Tasks, Backup, Full and picked a location on the C drive.

Copied this file over to machine 'B', and have tried to go attach and it give me an error saying the the database is not the primary database file , error 5171.....did I do the backup incorrectly ??

10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

did you restore the bakuped file..
sql databases basicly consist of two files with the extensions .mdf and .ldf .
You can attach these files as database files... check that...
You basically have two options... (er, well maybe 3)
  • Perform a backup and restore operation to move the database
  • Perform a detatch/attach operation
  • Use the copy database wizard
So, it looks like you did a backup, and file is probably a *.bak file.   You'd use the SQL Management Studio to create a new database and perform the restore operation
Mark WillsTopic AdvisorCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Split: graye {http:#22905283} & tigin44 {http:#22905352} & graye {http:#22908024}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.