日期:2014-05-18 浏览次数:20482 次
--这个命令最多只能with file=XX --可以将输出结果导入一个临时表中,之后就自由的进行各种操作了 create table #filelistinfo ( LogicalName nvarchar(128) null, PhysicalName nvarchar(260) null, Type char(1) null, FileGroupName nvarchar(128) null, FileSize bigint null , FileMaxSize Bigint null, 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 uniqueidentifier NULL, DifferentialBaseLSN numeric(25,0) NULL, DifferentialBaseGUID uniqueidentifier, IsReadOnly bit, IsPresent bit ) declare @filelistSQL varchar(8000) set @filelistSQL = 'restore filelistonly from disk=''D:\123.bak''' insert into #filelistinfo exec(@filelistSQL)