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

后端 未结 15 2594
挽巷
挽巷 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-11-30 23:50

    For the current database you can just use:

    select physical_name fromsys.database_files;

    to specify another database e.g. 'Model', use sys.master_files

    select physical_name from sys.master_files where database_id = DB_ID(N'Model');

提交回复
热议问题