How to read database name from SQL Server .bak file? [closed]

7qhs6swi  于 2023-04-19  发布在  SQL Server
关注(0)|答案(2)|浏览(149)

Closed. This question needs details or clarity . It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post .

Closed 7 years ago.
Improve this question

I have SampleDB.bak file. Is it possible to read Db Name within this .bak file without restoring?

iyfamqjs

iyfamqjs1#

Below query will give you the logical file(Data file and Log File) name of the backup.

RESTORE FILELISTONLY FROM DISK = 'D:\MyBackups\Backup.bak'

Fore more info on FILELISTONLY

gcuhipw9

gcuhipw92#

You can use below TSQL query

RESTORE HEADERONLY FROM DISK='D:\Database\Northwind.bak'

相关问题