Create database with MDF File

  • Is there a way I can create a database using the MDF (xyz.mdf) file which was sent by one of our clients.

    This is in SQL SERVER 7.0

    Thankyou

    Mkumari

  • Should be able to create a SQL DB, and then import all the tables from the Access database using the DTS import wizard.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • If it is a SQL7 MDF then try sp_attach_db

    I believe is must have same system properties (sort order etc)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Greg Larson can you explain little more on importing thr tables from the access.

  • DavidBurrows, I have tried to attach the database but it did not help since it was asking for the existing database name.I am not sure if I am doing it right.

  • I misread you original post as MDB, and not MDF. I'm guess an MDF file is most likely a SQL database file.

    Try this:

    sp_attach_single_file_db @dbname='<Replace with your DBName>'

    , @physname = '<replace with the physical location>'

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • I have tried attaching single file but it is not working.Does the database needs to be existant previously on the server I am trying to attach.Can I give any name to the database?

  • No, but you can have multiple problems. If the database came from 2000 then it cannot be attached to 7. Also, if the database was made up of multiple mdf/ndf and ldf files then it will not allow attach without all the ndfs or all the ldfs. Ask the client where it came from and instead of sending you the mdf do a BACKUP DATABASE so that you can restore it, which in your case will be far simplier than explaining all the details to the client. Again keep in mind 200 will not work with 7, but 7 will work with 2000, one way upgrade.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply