Home Forums SQL Server 2005 Administering get total disk space per instance from within SQL without cmdshell. RE: get total disk space per instance from within SQL without cmdshell.

  • Syed Jahanzaib Bin hassan (5/11/2011)


    declare @driveName varchar(100)

    declare @query varchar(1000)

    declare @fsinfo varchar(1000)

    set @driveName = 'C'

    set @query ='fsutil volume diskfree '+@driveName+':\'

    set @fsinfo = 'fsutil fsinfo volumeinfo '+@driveName+':\'

    exec xp_cmdshell @query

    exec xp_cmdshell @fsinfo

    check this T-SQL

    Forgot to read again???