How to attach and detach a database in SQL 7.0

  • i know How to attach and detach a database in SQL 2000 but How to

    > attach and detach a database in SQL 7.0. i think there is no option.

    > please give me solution. Ajay Sharma (UserID=164137)

  • sp_attach_db and sp_detach_db are available in SQL 7.0 also...these can be used to attach and detach databases in SQL 7.0...

  • hi,

    Thanks a lot for reply but how to attach and detach database in enterprise manager

    Thanks

    Ajay

  • I don't think attach / detach are available from EM in SQL 7.0...you'd have to use the stored procedures for the same...

  • Don't forget to put the database in single user mode first.

    And run "update statistics" after you're finished.

    Do something like...

    exec sp_dboption 'your_database_name', 'single user', true

    exec sp_detach_db 'your_database_name'

    -------------------------------------------------------------

    -- MANUALLY COPY/PASTE .MDF/.LDF FILES TO NEW SERVER --

    -------------------------------------------------------------

    exec sp_attach_db 'your_database_name',

     'path\your_database_name.MDF',

     'path\your_database_log.LDF'

    use [your_database_name]

    exec sp_updatestats

     

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

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