Best script to restore multiple databases with SQL Server 2012?

前端 未结 5 524
悲&欢浪女
悲&欢浪女 2021-02-06 10:29

I have to restore around 60 SQL databases of different sizes. I googled to find a script to restore all databases after each other , just picking it 1 by 1 from my folder. I was

5条回答
  •  情书的邮戳
    2021-02-06 11:05

    in recent SQL version there is new Column "SnapshotUrl" so small modifications is required:

    DECLARE @filelist TABLE 
    (
    LogicalName varchar(255), 
    PhysicalName varchar(255), 
    Type varchar(20), 
    FileGroupName varchar(255), 
    Size varchar(20), 
    MaxSize varchar(20),
    FileId int,
    CreateLSN bit, 
    DropLSN bit, 
    UniqueID varchar(255),
    ReadOnlyLSn bit, 
    ReadWriteLSN bit, 
    backupSizeInBytes varchar(50), 
    SourceBlockSize int,
    FileGroupid Int, 
    LogGroupGUID varchar(255),
    DifferentialBaseLSN varchar(255),
    DifferentialBaseGUID varchar(255),
    isReadOnly bit, 
    IsPresent bit,
    TDEThumbprint varchar(255),
    SnapshotUrl varchar(255) 
    )
    

提交回复
热议问题