LiCongMingDeShujuku / Get-Drive-Info-With-Xp_FixedDrives

使用Xp_FixedDrives获取驱动器信息

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLEVER DATA GIT REPO

使用Xp_FixedDrives获取驱动器信息

Get Drive Info With Xp_FixedDrives

发布-日期: 2015年06月16日 (评论)

Contents

中文

这是一些从xp_fixed驱动器获取结果,并将其放在一个表中的快速逻辑。然后对该表的快速查询显示还有多少GB可用空间量。这个逻辑快速而简单。

English

Here’s some quick logic which takes the results from xp_fixed drives, and puts it in a table. Then a quick query against that tables shows the amount of free space in GB. It’s quick, and simple. Those are the best ones.


Logic

use master;
set nocount on
if exists (select object_id('tempdb..#get_drive_info'))
drop table #get_drive_info
 
create table #get_drive_info
(
  drive char(1) not null
, mbfree int not null
)
insert into #get_drive_info
exec xp_fixeddrives
 
select
  'drive' = drive
, 'gb free' = mbfree / 1024
from
#get_drive_info
order by
drive asc

#

WorksEveryTime

Build-Info

Build Quality Build History
Build-Status
Coverage
Nuget
Build history

Author

  • 李聪明的数据库 Lee's Clever Data
  • Mike的数据库宝典 Mikes Database Collection
  • 李聪明的数据库 "Lee Songming"

Gist Twitter Wordpress


License

LicenseCCSA

Lee Songming

About

使用Xp_FixedDrives获取驱动器信息