restore filelistonly from disk='D:\123.bak' 命令如何获取第一条记录,好像后面不能跟where字句。
默认搜索出来的有两条记录。我想只要第一条可以吗?
要怎么筛选?
------解决方案--------------------
- SQL code
--这个命令最多只能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)