On which file the table will be created?

  • Please refer the below scenario:

    -- a) create a databse with multi filegroups and files

    Create database projects

    on primary

    (Name=Projects, Filename='C:\Projects\Projects.mdf', size=100MB, Filegrowth=20),

    Filegroup FG1

    (Name=Projects_FG1_1, Filename='C:\Projects\Projects_FG1_1.ndf', size=100MB, Filegrowth=20)

    (Name=Projects_FG1_2, Filename='C:\Projects\Projects_FG1_2.ndf', size=100MB, Filegrowth=20)

    log on

    (Name=Projects, Filename='C:\Projects\Projects.ldf', size=100MB, Filegrowth=20)

     

    --Create a table on secondary filegroup

    create table test(Name navrchar(5)) on FG1

     

    After creating the table. In which file, do the table get stored in FG1 filegroup.

  • Both.

    If there are multiple files in a filegroup SQL will stripe data across all of them.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks fro your immediate reply.

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

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