RG RESTORE FILELISTONLY resultset doesn't match SQL native
dhtucker
Posts: 41 Bronze 3
According to MSDN, the resultset from RESTORE FILELISTONLY should be:
1) TDEThumbrint isn't returned at all (personally, I didn't care)
2) LogGroupGUID is returned as a character string, not UNIQUEIDENTIFIER (this caused an error)
Here's the table definition I used so that I could capture the resultset from a RESTORE FILELISTONLY call:
DECLARE @tblFileList TABLE (
LogicalName nvarchar(128),
PhysicalName nvarchar(260),
[Type] char(1),
FileGroupName nvarchar(128),
Size numeric(20,0),
MaxSize numeric(20,0),
FileID bigint,
CreateLSN numeric(25,0),
DropLSN numeric(25,0) NULL,
UniqueID uniqueidentifier,
ReadOnlyLSN numeric(25,0) NULL,
ReadWriteLSN numeric(25,0) NULL,
BackupSizeInBytes bigint,
SourceBlockSize int,
FileGroupID int,
LogGroupGUID VARCHAR(36) null,
DifferentialBaseLSN numeric(25,0) NULL,
DifferentialBaseGUID UNIQUEIDENTIFIER,
IsReadOnly bit,
IsPresent bit
)
INSERT @tblFileList
EXECUTE master..sqlbackup '-SQL "RESTORE FILELISTONLY
FROM DISK = ''your_pathname_goes_here.sqb'' '
The resultset returned from RedGate's RESTORE FILELISTONLY varies in at least two respects:declare @fileListTable table(
LogicalName nvarchar(128),
PhysicalName nvarchar(260),
[Type] char(1),
FileGroupName nvarchar(128),
Size numeric(20,0),
MaxSize numeric(20,0),
FileID bigint,
CreateLSN numeric(25,0),
DropLSN numeric(25,0),
UniqueID uniqueidentifier,
ReadOnlyLSN numeric(25,0),
ReadWriteLSN numeric(25,0),
BackupSizeInBytes bigint,
SourceBlockSize int,
FileGroupID int,
LogGroupGUID uniqueidentifier,
DifferentialBaseLSN numeric(25,0),
DifferentialBaseGUID uniqueidentifier,
IsReadOnly bit,
IsPresent bit,
TDEThumbprint varbinary(32)
)
1) TDEThumbrint isn't returned at all (personally, I didn't care)
2) LogGroupGUID is returned as a character string, not UNIQUEIDENTIFIER (this caused an error)
Here's the table definition I used so that I could capture the resultset from a RESTORE FILELISTONLY call:
DECLARE @tblFileList TABLE (
LogicalName nvarchar(128),
PhysicalName nvarchar(260),
[Type] char(1),
FileGroupName nvarchar(128),
Size numeric(20,0),
MaxSize numeric(20,0),
FileID bigint,
CreateLSN numeric(25,0),
DropLSN numeric(25,0) NULL,
UniqueID uniqueidentifier,
ReadOnlyLSN numeric(25,0) NULL,
ReadWriteLSN numeric(25,0) NULL,
BackupSizeInBytes bigint,
SourceBlockSize int,
FileGroupID int,
LogGroupGUID VARCHAR(36) null,
DifferentialBaseLSN numeric(25,0) NULL,
DifferentialBaseGUID UNIQUEIDENTIFIER,
IsReadOnly bit,
IsPresent bit
)
INSERT @tblFileList
EXECUTE master..sqlbackup '-SQL "RESTORE FILELISTONLY
FROM DISK = ''your_pathname_goes_here.sqb'' '
Doug Tucker
Database Administrator / Software Engineer
Nelnet Business Solutions - FACTS-SIS
Database Administrator / Software Engineer
Nelnet Business Solutions - FACTS-SIS