Solved

Microsoft SQL 2008 EXPRESS Server Import mdf

Posted on 2009-04-14
12
1,709 Views
Last Modified: 2012-05-06
I have a database I'm trying to import and get setup into Express 2008 and I don't know how to do this.  I've copied it from(file.mdf)  a remote (local dev. environment) to the webserver.  Now, how do I get 2008 to recognize it as a db?  And, just for fun, can anyone answer why is this so hard?  I'm sure it has something to do with security, but darn...

Thanks,

Wend
0
Comment
Question by:wkolasa
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 15

Expert Comment

by:MohammedU
ID: 24140590
First make sure you have SQL Server 2008 installed on your destination server and then use the following instructions to attach a db...

http://msdn.microsoft.com/en-us/library/ms165673.aspx
http://www.kodyaz.com/articles/sql-server-attach-database-mdf-file.aspx
http://technet.microsoft.com/en-us/library/ms190209.aspx
0
 

Author Comment

by:wkolasa
ID: 24140656
I have sql2008 EXPRESS on destination server... I'm getting the database (local machine) from 2005 Express
0
 
LVL 15

Expert Comment

by:MohammedU
ID: 24140674
Then follow the instrunctions from http://msdn.microsoft.com/en-us/library/ms165673.aspx
OR
Backup the database from source server then Restore it...
Check the Books online for backup and restore command.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

Author Comment

by:wkolasa
ID: 24141147
This is actually what I was looking for:

Open SQL Management Studio Express and log in to the server to which you want to attach the database. In the 'Object Explorer' window, right-click on the 'Databases' folder and select 'Attach...' The 'Attach Databases' window will open; inside that window click 'Add...' and then navigate to your .MDF file and click 'OK'. Click 'OK' once more to finish attaching the database and you are done. The database should be available for use.
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 24143209
when going from 2005 to 2008 better to use the SQL backup and restore. You will also want to update statistics, possibly update indexes, especially if you are now using sql 2008 compatability mode.

Also those links from mohammedU were pretty good, not sure why you have not awarded the accepted solution to the first post, they lead directly to http://msdn.microsoft.com/en-us/library/ms191491.aspx  which is the SSMS way,,,
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 24144490
>>not sure why you have not awarded the accepted solution to the first post<<
But the author is awarding MohammedU's a whoppng 50 points for their trouble. :)
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 24144800
Yeah, very generous a 10% award for at least an 80% answer (had to click on a link or two inside the posted links), that lead to the 100% solution that the asker awarded themselves. Cool.

BTW acperkins, how do you find these interesting ones ?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 24147506
>>BTW acperkins, how do you find these interesting ones ?<<
I just read the opening question and I can tell the way it is going to end up.  Re-read this one and you can see what I mean.
0
 

Author Comment

by:wkolasa
ID: 24150703
I didn't award the full points b/c the solution I posted was the exact solution I was looking for.  Also, 500 points for a link(s).  I can google solutions as well.  There's more discussion about how many points I award than about an actual solution.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 24150757
>>There's more discussion about how many points I award than about an actual solution.<<
And why do you think that is the case?
0
 
LVL 51

Accepted Solution

by:
Mark Wills earned 500 total points
ID: 24150932
I count 5 posts to your original question (including my first one with those words of warning about indexes and stats), and only 3 about points...

Yes you could have googled, but didn't, it can be tricky to get the search to return such a succinct and directed list. Sometimes the link paints a prettier picture rather than simply copy and paste from Books On Line - might be a link, but never underestimate the value of those links, often saved as our own useful bits.  And the art is in knowing what question to ask...

Besides which there is relevant associated information as to upgrading, a few gotcha's, replication, full text searching, what to do with metadata, and so on. There is potentially more than just attaching a database, and we do not know what you have in that database.

Nobody has objected to your request to close that way.
0
 

Author Closing Comment

by:wkolasa
ID: 31570047
You get all the points for two reasons.  A) I want to close this question B) You're nice about all of this.

Thanks ~ Wendi
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Count with a subquery showing details 10 59
sql 2014,  lock limit 5 46
Sql Server group by 10 51
MSSQL Convert Char to Date Time 5 11
Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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