使用SERVERPROPERTY()来得到Data和Log的默认路径:

获取Data和Log默认路径

 

InstanceDefaultDataPath和InstanceDefaultLogPath分别返回默认数据和日志目录。

 

DECLARE @ddp sql_variant = SERVERPROPERTY('InstanceDefaultDataPath')
DECLARE @dlp sql_variant = SERVERPROPERTY('InstanceDefaultLogPath')


SELECT [Default Data Path] = @ddp,[Default Log Path] = @dlp
Source Code

相关文章:

  • 2021-10-07
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
猜你喜欢
  • 2022-12-23
  • 2021-08-16
  • 2021-12-04
  • 2021-09-25
  • 2022-12-23
相关资源
相似解决方案