How do I find the data directory for a SQL Server instance?

后端 未结 15 2633
挽巷
挽巷 2020-11-30 23:16

We have a few huge databases (20GB+) which mostly contain static lookup data. Because our application executes joins against tables in these databases, they have t

15条回答
  •  误落风尘
    2020-12-01 00:08

    Keeping it simple:

    use master
    select DB.name, F.physical_name from sys.databases DB join sys.master_files F on DB.database_id=F.database_id
    

    this will return all databases with associated files

提交回复
热议问题