Solved

How to import a *.MDF & *.LDF file into SQL Server ?

Posted on 2002-05-20
3
638 Views
Last Modified: 2008-03-10
Hi,

  I got two SQL Server files: product.mdf and product.ldf. How can I import these files(and creat a database for that) into SQL Server by using Enterprise Manager ?


Thanks

Richard
0
Comment
Question by:richardluo
3 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7022846
Take a look at sp_attach_DB

From SQL Analyzer (assuming you have copied the MDF and LDF to the c:\Program Files\Microsoft SQL Server\MSSQL\Data folder):
EXEC sp_attach_db @dbname = N'Product',
   @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\product.mdf',
   @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\product.ldf'

Anthony
0
 
LVL 4

Accepted Solution

by:
TheSpirit earned 100 total points
ID: 7023416
You can do this via enterprise manager, Highlight the databases key on the left hand side, then right click and move on to all tasks, there should be the attach option from there.
0
 

Author Comment

by:richardluo
ID: 7025109
Thanks guys
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Exceptions 3 38
sql query questions 2 21
t-sql split string into multiple rows 7 35
SQL bit field not working as expected 3 20
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now