Increase Datafile .mdf

  • Hi All,

    I am running out of space with my Datafile .mdf, I don't have enough free space on my C:\Drive, how can I do to move files onto my D:\Drive....also is there any posibility to create a new Datafile??..can I do that when I get out of space?

    Please any help???

    Thanks

  • There are a few methods you could use: sp_detach_db/sp_attach_db, BACKUP/RESTORE or ALTER DATABASE.

    The steps to move the datafile using ALTER DATABASE would look something like this.

    1) ALTER DATABASE myDB SET OFFLINE

    2) Move MYDB.MDF to the D:\DATA\MYDB.MDF.

    3) ALTER DATABSE myDB MODIFY FILE (NAME = 'myDB', FILENAME = 'D:\data\mydb.mdf')

    4) ALTER DATABASE myDB SET ONLINE

  • Rightclick on the database..Select option to detach the database..

    move the file to D Drive

    Attach it back

    Regards
    Venkat
    http://sqlblogging.blogspot.com[/url]

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

You must be logged in to reply to this topic. Login to reply