How do I capture the output from the following SQL statement so I can query the resultset?:
RESTORE FILELISTONLY FROM
DISK = N''D:\Restores\MyBackup.BAK'' WITH NOUNLOAD,
FILE = 1
Do I need to create a temporary table and then do something like?:
INSERT #tmp EXEC ('RESTORE FILELISTONLY FROM
DISK = N''D:\Restores\KevsProfilerTraces.BAK'' WITH NOUNLOAD, FILE = 1')
I basically want to query the LogicalName
and PhysicalName
columns for some management tasks.
Or is there an easier way?