Friday, March 9, 2012

How to import an mdf-file

Hi,on my developement PC i have installed MS Sql server. A customer with my program using msde sent me his .mdf file so that i can check his data. How do i import or connect to his database file for debugging
Regards
OlavTry attaching the file using sp_attach_single_file_db. You
can find more information on using this stored procedure in
books online.
-Sue
On Tue, 25 May 2004 04:26:04 -0700, "Olav"
<anonymous@.discussions.microsoft.com> wrote:
>Hi,on my developement PC i have installed MS Sql server. A customer with my program using msde sent me his .mdf file so that i can check his data. How do i import or connect to his database file for debugging?
>Regards,
>Olav|||You can try the stored procedure sp_attach_single_file_db (see Books Online
for usage and syntax). Without a log file, if the database wasn't cleanly
detached, it's not a guaranteed move. You should try to get the user to
send you a synchronized and properly detached MDF+LDF pair.
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Olav" <anonymous@.discussions.microsoft.com> wrote in message
news:E7DC9CD6-1952-4896-9C62-5D9C311674A0@.microsoft.com...
> Hi,on my developement PC i have installed MS Sql server. A customer with
> my program using msde sent me his .mdf file so that i can check his data.
> How do i import or connect to his database file for debugging?
> Regards,
> Olav|||Thanks a lot, it worked
Is there a better way to connect a customer database
Regards,
Olav|||If all you have is an mdf, it seems the only choice you'd
have would be sp_attach_single_file_db.
The customer should make sure to use sp_detach_db if you are
going to attach a database using sp_attach_db or
sp_attach_single_file_db.
Another option would be for the customer to give you a
backup file. You can restore this backup to your server.
-Sue
On Tue, 25 May 2004 05:21:05 -0700, "Olav"
<anonymous@.discussions.microsoft.com> wrote:
>Thanks a lot, it worked!
>Is there a better way to connect a customer database?
>Regards,
>Olav

No comments:

Post a Comment