1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
Use master declare @vclogPath varchar (255), @vcHelloDB varchar (255) SET @vcHelloDB = 'D:\Database\hello.BAK' --Create Table #tempHello here Insert #tempHello EXEC('RESTORE FILELISTONLY FROM DISK = ''' + @vcHelloDB + ''' ')