[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 340
  • Last Modified:

Mount an MDF file as a database.

I had a SQL 7 server that stopped working for some reason - i.e the service wouldn't start(probably due to something else I installed). After uninstalling and reinstalling the service now starts. How do I tell SQL 7 to look at the old mdf files as databases?
0
egunn
Asked:
egunn
1 Solution
 
markshifferCommented:
look at sp_attachdb

exp.

exec sp_attach_db 'DBNAME', N'c:\DB.mdf'

Its been awhile since I've used it but I believe that is the proper implementation. The stored proc can be found in the master database.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now