Home Forums SQL Server 2005 SQL Server Express Copy rows returned from a RESTORE FILELISTONLY command into a tble RE: Copy rows returned from a RESTORE FILELISTONLY command into a tble

  • I would also like to do a similar thing with the HEADERONLY but when I try to clone your code I get an error. Here is my code:

    SELECT a.* INTO #hdr FROM OPENROWSET('SQLNCLI','Server=(local)\SQLEXPRESS;Trusted_Connection=yes',

    'EXEC(''SET FMT OFF RESTORE HEADERONLY FROM DISK =''''c:\code3Billing\ClientSQLData\Master\code3billing.bak '''''')') AS a

    Here is the error:

    Cannot process the object "EXEC('SET FMT OFF RESTORE HEADERONLY FROM DISK =''c:\code3Billing\ClientSQLData\Master\code3billing.bak ''')". The OLE DB provider "SQLNCLI" for linked server "(null)" indicates that either the object has no columns or the current user does not have permissions on that object.

    Am I missing something???