Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Posts
    50

    Unanswered: calculate the size of a database and backup it.

    Hi all,
    please show me the way how to calculate the size of a database in SQL 2000. Whith this size we have already calculated, how much space need to make a backup file for this database.

    thanks.

  2. #2
    Join Date
    Jul 2003
    Location
    England
    Posts
    152
    Easiest way is through Enterprise manager - via the View - TaskPad options. This will show you size of data file(s) and log file(s).

    Backup size will be the sum of these sizes approx.

    You can also get it from the sysfiles table.
    Regards
    Dbabren

  3. #3
    Join Date
    Feb 2004
    Location
    Rhode Island
    Posts
    69

    Re: calculate the size of a database and backup it.

    Originally posted by thanhtung2003
    Hi all,
    please show me the way how to calculate the size of a database in SQL 2000. Whith this size we have already calculated, how much space need to make a backup file for this database.

    thanks.
    If you want to find out programaticaly use sp_spaceused

  4. #4
    Join Date
    Jan 2004
    Posts
    50

    Re: calculate the size of a database and backup it.

    Originally posted by smasanam
    If you want to find out programaticaly use sp_spaceused
    Hi,
    please, tell me how to use it ?

  5. #5
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Please consult the Microsoft Transact-SQL Reference, specifically 'System Stored Procedures'
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  6. #6
    Join Date
    Dec 2003
    Posts
    31
    create table #DbSize (name nvarchar(30),
    rows char(11),
    reserved varchar(18),
    data varchar(18),
    index_size varchar(18),
    unused varchar(18))

    exec <your database name>..sp_msforeachtable @command1 = 'insert into #DbSize exec dbs..sp_spaceused [?]'


    select sum(cast(replace(Reserved, 'KB','')as int)) From #DbSize

    drop table #DbSize

Posting Permissions

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