RG RESTORE FILELISTONLY resultset doesn't match SQL native

dhtuckerdhtucker Posts: 42 Bronze 3
edited August 15, 2011 2:14PM in SQL Backup Previous Versions
According to MSDN, the resultset from RESTORE FILELISTONLY should be:
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)
)
The resultset returned from RedGate's RESTORE FILELISTONLY varies in at least two respects:
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
Sign In or Register to comment.