SQL restore filelistonly 问题 restore filelistonly from disk='D:\123.bak' 命令如何获取第一条记录,好像后面不能跟where字句。默认搜索出来的有两条记录。我想只要第一条可以吗?要怎么筛选? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 js_szy什么意思?给点实质的东西 restore filelistonly 没用过用这个试试restore filelistonly from disk='D:\123.bak'WITH FILE=1 --这个命令最多只能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)注:临时表的结构要和restore filelistonly 命令的输出结果集相同,可能在不同的SQL版本下有所差异,注意自行调整PS:楼主,分太少了吧 天啊 发现白写这么多代码了!求救!!(下班结帖) 在线等一个简单数据库查询问题 DTS定期执行问题 使用ole处理数据库中word文档的问题 求条SQL语句 实在是不会写啊!!请教一个超级难的存储过程问题!!! 表这么设计是否冗余 真是不敢用SQL Server了,太不安全了,觉得被完全暴露 创建表失败,提示创建对象已存在,这是什么问题? 一个SQL语句问题请教 请问mssql2000里这样的排序如果实现呢 求SQL语句
用这个试试restore filelistonly from disk='D:\123.bak'WITH FILE=1
--这个命令最多只能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)注:临时表的结构要和restore filelistonly 命令的输出结果集相同,可能在不同的SQL版本下有所差异,注意自行调整PS:楼主,分太少了吧