Results 1 to 6 of 6

Thread: file properties

  1. #1
    Join Date
    Jul 2004
    Posts
    61

    Unanswered: file properties

    Hi all,

    I'm having a problem need your help:

    I can see all properties of datafile (FilegroupName, FileID, FileType,
    Location, CurrentSize, Space Used) by Enterpise Manager.

    Please tell me how do I see all those properties by SQL Query Analyzer.
    I want to know actual space used in data file to shrink file.

    Thanks in advanced,
    TN

  2. #2
    Join Date
    Feb 2004
    Posts
    492
    There's a bunch of system procedures that can get your started; sp_helpfile and sp_spaceused.

  3. #3
    Join Date
    Jul 2004
    Posts
    61
    thanks for your help
    but I want to know exactly used space in data file to shrink to.
    because I have a DB:
    current size : 10000MB
    space used : 814 MB

    I want ot shrink the data file down around 850 MB.

    Thanks
    TN

  4. #4
    Join Date
    Aug 2002
    Location
    Prague
    Posts
    77
    The best way is to query sysindexes system table. Look into sp_spaceused code to see how the used space is computed.

  5. #5
    Join Date
    Dec 2004
    Location
    Kharkov, Ukraine
    Posts
    40
    See BOL
    DBCC SHRINKDATABASE

  6. #6
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    use master;
    select
    'Data device'=fileproperty('master','spaceused'),
    'Log device'=fileproperty('mastlog','spaceused')
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •