Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • Reply To: Get file sizes of database files and free space on disk

    Hello Perry,

    I want to fetch all these below mentioned columns, and we have versions from sql server 2008 to sql server 2016.

    Database Name

    Type

    File Name

    File Group Name

    File_Location

    FileSize_MB

    UsedSpace_MB

    FreeSpace_MB

    FreeSpace %

    Auto Growth

    volume_mount_point

    Total Volume Size_...

  • Reply To: Get file sizes of database files and free space on disk

    DECLARE @ServerVersion varchar(100)

    SET @ServerVersion = CONVERT(varchar,SERVERPROPERTY('productversion'))

    SET @ServerVersion = LEFT(@ServerVersion, CHARINDEX('.',@ServerVersion, 4)-1)

    --PRINT @ServerVersion

    DECLARE @command nvarchar(2000)

    IF OBJECT_ID('tempdb..#FileData','U') IS NOT NULL

    BEGIN

    PRINT 'Dropping #FileData'

    DROP TABLE tempdb..#FileData

    END

    CREATE TABLE tempdb..#FileData

    (

    [CurrentHost] varchar(250) COLLATE Latin1_General_CI_AS NULL,

    [ClusterNodes] varchar(250) COLLATE...

Viewing 2 posts - 1 through 2 (of 2 total)