Adding new data file

  • Hi,

    Can add a data file to database without restarting server?

    Regards

    Binu John

  • Sorry Friends,

    I got the T-sql from BOL,and added a new file without restarting server.

    ALTER DATABASE Test

    ADD FILE

    (

    NAME = Test1dat1,

    FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL\data\test_Data1.ndf',

    SIZE = 5MB,

    MAXSIZE = 100MB,

    FILEGROWTH = 5MB

    )

    Sorry for disturbing you.

  • np... this will surely help somebody in the future.

    Thanx for the contribution.

  • No. You don't need to restart the server. However, I will not add the file when there are users performing changes. I would recommend do this at non-business hours.

    Also, it is much easier doing this from Enterprise Manager. Just right click at the desired database and select Properties. Then click Data Files tab and add the new file information in the blank. The "File Name" is the logical name. "Location" is the physical filename which corresponds to the FILENAME of TSQL command. "Space Allocated (MB)" corresponds to "SIZE". "Restricted file growth (MB)" corresponds to "MAXSIZE", and "In megabytes" in the "File growth" section corresponds to "FILEGROWTH"

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

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