Attaching mulitple databases

  • Hi, I'm pretty new to SQL, not a specific DBA and I'm not sure of the query command to attach multiple databases & logs to a new SQL server.

    I know the "sp_attach_db" command for a single database, however I've got 50 databases that need attaching to this particular server (SQL2000 SP4). I've copied all mdf & ldf files locally.

    Any help greatly appreciated..

    thx,

    Duncan

  • create a temp table with databasenames, and log file locations..etc..

    Use a cursor to use sp_attach_db to attach each on.

    HTH


    Mathew J Kulangara
    sqladventures.blogspot.com

Viewing 2 posts - 1 through 1 (of 1 total)

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