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

后端 未结 15 2641
挽巷
挽巷 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:07

    Alex's answer is the right one, but for posterity here's another option: create a new empty database. If you use CREATE DATABASE without specifying a target dir you get... the default data / log directories. Easy.

    Personally however I'd probably either:

    • RESTORE the database to the developer's PC, rather than copy/attach (backups can be compressed, exposed on a UNC), or
    • Use a linked server to avoid doing this in the first place (depends how much data goes over the join)

    ps: 20gb is not huge, even in 2015. But it's all relative.

提交回复
热议问题