How to insert the resultset given by the commands
RESTORE FILELISTONLY
RESTORE HEADERONLY
RESTORE VERIFYONLY
into an automatically generated temp table ?
I would like to use a technique similar to (so the table is auto created, with all the columns matching the resultset's columns)
SELECT * INTO #TempTable
FROM (RESTORE FILELISTONLY FROM DISK = 'c:\Test\Test.bak')
But this doesn't work. If I could populate a TempTable I could then be able to use the information contained in it in a following SQL Statement (in my case a restore DB statement in which I need to use some strings contained in the resultset given by RESTORE FILELISTONLY)
I am using sql server 2008.