Save my database to Jump drive and import into another SQL Server on laptop

  • Hi,

    How do I export my SQL Server database out of SQL Server? So that I can import it into SQl Server on another machine?

    I looked at the import export options, and there does not appear to be an option either to export to or import from a standalone *.MDF file. It seems you can only export directly into another SQL Server on the same network.

  • If you take the database offline you can copy the mdf and ldf and then attach them on the next server. Then put the database back on-line. I would take a full backup and then copy the backup to the jump drive. THen you create a new database on the other server from the backup.

    Disclaimer:

    This is of course advice to be taken only if you are legally allowed to take this database off the network.

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

  • OK, so these are the steps then?

    1, Stop the server

    2, Copy the database and log file to the jump drive

    3, "ATTACH THE DATABASE AND LOG FILES ON THE NEXT SERVER", (what do you mean by this exactly, do you mean simply stop the SQL Server and paste them into the directory where all the other databases are stored?)

  • Taking the backup is really a better way to do it.

    But yes your 1st 2 steps will work. Then step 3 on the server would be copy/paste the files onto your data and log drives. Then you do sp_attach_db like this:

    EXEC sp_attach_db @dbname = N'AdventureWorks',

    @filename1 = N'c:\Program Files\Microsoft SQL Server

    \MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf',

    @filename2 = N'c:\Program Files\Microsoft SQL Server

    \MSSQL.1\MSSQL\Data\AdventureWorks_log.ldf' ;

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

Viewing 4 posts - 1 through 3 (of 3 total)

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