Attaching Database with > 16 segments

  • I am attempting to attach a database which has 22 segments/files. Unfortunately, the system is choking on my script to do this.

    Does anyone have a script/example of what they have used?

    Thank you.

    Steve

    Steve Jimmo
    Sr DBA
    “If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan

  • Use "create database forattach".

    CREATE DATABASE PR2

      ON

     (name = 'PR2DATA1', filename = 'S:\PR2DATA\PR2DATA1.MDF'),

     (name = 'PR2DATA2', filename = 'S:\PR2DATA\PR2DATA2.NDF'),

     (name = 'PR2DATA3', filename = 'T:\PR2DATA\PR2DATA3.NDF'),

     (name = 'PR2DATA4', filename = 'T:\PR2DATA\PR2DATA4.NDF'),

     (name = 'PR2DATA5', filename = 'T:\PR2DATA\PR2DATA5.NDF'),

     (name = 'PR2DATA6', filename = 'T:\PR2DATA\PR2DATA6.NDF'),

     (name = 'PR2DATA7', filename = 'T:\PR2DATA\PR2DATA7.NDF'),

     (name = 'PR2DATA8', filename = 'T:\PR2DATA\PR2DATA8.NDF'),

     (name = 'PR2DATA9', filename = 'T:\PR2DATA\PR2DATA9.NDF'),

     (name = 'PR2DATA10', filename = 'T:\PR2DATA\PR2DATA10.NDF'),

     (name = 'PR2DATA11', filename = 'T:\PR2DATA\PR2DATA11.NDF'),

     (name = 'PR2DATA12', filename = 'T:\PR2DATA\PR2DATA12.NDF'),

     (name = 'PR2DATA13', filename = 'T:\PR2DATA\PR2DATA13.NDF'),

     (name = 'PR2DATA14', filename = 'T:\PR2DATA\PR2DATA14.NDF'),

     (name = 'PR2DATA15', filename = 'T:\PR2DATA\PR2DATA15.NDF'),

     (name = 'PR2DATA16', filename = 'T:\PR2DATA\PR2DATA16.NDF'),

     (name = 'PR2DATA17', filename = 'T:\PR2DATA\PR2DATA17.NDF'),

     (name = 'PR2DATA18', filename = 'Q:\PR2DATA\PR2DATA18.NDF'),

     (name = 'PR2DATA19', filename = 'Q:\PR2DATA\PR2DATA19.NDF'),

     (name = 'PR2DATA20', filename = 'Q:\PR2DATA\PR2DATA20.NDF'),

     (name = 'PR2DATA21', filename = 'Q:\PR2DATA\PR2DATA21.NDF'),

     (name = 'PR2DATA22', filename = 'Q:\PR2DATA\PR2DATA22.NDF'),

     (name = 'PR2DATA23', filename = 'Q:\PR2DATA\PR2DATA23.NDF'),

     (name = 'PR2DATA24', filename = 'Q:\PR2DATA\PR2DATA24.NDF'),

     (name = 'PR2DATA25', filename = 'Q:\PR2DATA\PR2DATA25.NDF'),

     (name = 'PR2DATA26', filename = 'Q:\PR2DATA\PR2DATA26.NDF'),

     (name = 'PR2DATA27', filename = 'Q:\PR2DATA\PR2DATA27.NDF')

      LOG ON

     (name = 'PR2LOG1', filename = 'S:\PR2LOG1\PR2LOG1.LDF'),

     (name = 'PR2LOG2', filename = 'S:\PR2LOG1\PR2LOG2.LDF')

      FOR ATTACH

     

     

  • Thanks, I had forgotten all of the paren's.

    Steve Jimmo
    Sr DBA
    “If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan

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

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