Script to Create 100 Databases

  • It ran successfully! 🙂

    Thank you very much, Everett, for all your assistance.

    WM

  • One last question, Everett:

    How do I create a dump device for each database in the script?

    Thank you.

    WM

  • Hello.

    I unfortunately don't have any experience with the DUMP command beyond BOL which suggests it shouldn't be used (GURUS: IS THIS TRUE FOR A ONE TIME SHOT?).

    I ran the following script using the BACKUP command, it could probably be modified to use the DUMP command

    declare

    @BackUpvarchar(500),

    @DatabaseNamevarchar(500)

    Set @DatabaseName = 'Northwind'

    Set @BackUp = 'EXEC sp_addumpdevice ''disk'', ''' + @DatabaseName +

    ''', ''d:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\' + @DatabaseName + '.dat''' + CHAR(13) +

    'BACKUP DATABASE ' + @DatabaseName + ' TO ' + @DatabaseName

    exec(@BackUp)

    Everett

    Edited by - ewilson10 on 06/17/2003 11:58:18 AM



    Everett Wilson
    ewilson10@yahoo.com

  • Thanks again for your help, Everett.

    I got it to work.

    WM

Viewing 4 posts - 16 through 18 (of 18 total)

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