- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Sql Server 7
Operating System - Microsoft
1752695
Members
5701
Online
108789
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-13-2001 12:34 PM
тАО08-13-2001 12:34 PM
We had a problem with a virus. Had to reinstall our sql server database. I have the old mdf file and a backup done from enterprise manager. How can I get sql server to recognize the old database file?
the OS is NT 4.0
Thanks,
Ron
the OS is NT 4.0
Thanks,
Ron
life's a journey, not a destination
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-13-2001 02:51 PM
тАО08-13-2001 02:51 PM
Solution
Yes, you have to restore both data and log files for a database using the sp_attachdb command in Query Analyser.
If your database name is myDB, and the files are myDB_data.mdf and myDB_log.ldf
then the command would be:
sp_attach_db @dbname=N'myDB',@filename1=N'C:\mssql7\Data\myDB_data.mdf',@filename2=N'C:\mssql7\Data\myDB_log.ldf'
assuming that SQL is in the C:\mssql7 directory on your server.
If your database name is myDB, and the files are myDB_data.mdf and myDB_log.ldf
then the command would be:
sp_attach_db @dbname=N'myDB',@filename1=N'C:\mssql7\Data\myDB_data.mdf',@filename2=N'C:\mssql7\Data\myDB_log.ldf'
assuming that SQL is in the C:\mssql7 directory on your server.
If if ain't broke, don't fix it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-13-2001 02:51 PM
тАО08-13-2001 02:51 PM
Re: Sql Server 7
Yes, you have to restore both data and log files for a database using the sp_attach_db command in Query Analyser.
If your database name is myDB, and the files are myDB_data.mdf and myDB_log.ldf
then the command would be:
sp_attach_db @dbname=N'myDB',@filename1=N'C:\mssql7\Data\myDB_data.mdf',@filename2=N'C:\mssql7\Data\myDB_log.ldf'
assuming that SQL is in the C:\mssql7 directory on your server.
If your database name is myDB, and the files are myDB_data.mdf and myDB_log.ldf
then the command would be:
sp_attach_db @dbname=N'myDB',@filename1=N'C:\mssql7\Data\myDB_data.mdf',@filename2=N'C:\mssql7\Data\myDB_log.ldf'
assuming that SQL is in the C:\mssql7 directory on your server.
If if ain't broke, don't fix it.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP