I want somethign like this
But when i try to use it i get exceptions on this line i.e.
SET @query = 'RESTORE FILELISTONLY FROM DISK = ' + QUOTENAME(@BackupFile , '''')
Msg 213, Level 16, State 7, Line 1
Insert Error: Column name or number of supplied values does not match table definition.
Msg 3013, Level 16, State 1, Line 1
RESTORE FILELIST is terminating abnormally.
I'm sure this is a very common requirement so can anyone please tell me what im doing wrong or provide me with another alternative to this please