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
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)
)