Comments
Sort by recent activity
Taking your example of how to show that the FILELISTONLY is returning garbage, I was able to create a workaround. I was concerned with getting the logical file name, so that is what my example returns. This is very frustrating that I have to clean up a practically unusable resultset. :x CREATE TABLE #FileListOutputSQB (LogicalName nvarchar(128),
PhysicalName nvarchar(260),
Type char(1),
FileGroupName nvarchar(128) NULL,
Size varchar(20) NULL,
MaxSize varchar(20) NULL,
RowNum int identity(1,1))
insert #FileListOutputSQB
exec master.dbo.sqlbackup '-I -E -SQL "RESTORE FILELISTONLY FROM DISK=''e:\mssql\backup\admin\Admin_db_200603070200.SQB''"'
select '"' + LogicalName + '"' from #FileListOutputSQB where Type = 'D'
declare @i int
declare @ascii int
declare @DataLogicalName varchar(128)
set @DataLogicalName = ''
set @I = 1
while @I <= 128
begin
select @ascii = ascii(substring(logicalname,@i,1)) from #FileListOutputSQB where Type = 'D'
if @ascii > 0
select @DataLogicalName = @DataLogicalName + substring(logicalname,@i,1) from #FileListOutputSQB where Type = 'D'
set @I = @I + 1
end
select '"' + @DataLogicalName + '"'
drop table #FileListOutputSQB
/ comments
Taking your example of how to show that the FILELISTONLY is returning garbage, I was able to create a workaround. I was concerned with getting the logical file name, so that is what my example ret...