How to specify the exact .ndf file on a filegroup to save a table in?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
3
down vote

favorite












I have a filegroup(not the primary one) which contains two different .ndf files, for example a1.ndf and a2.ndf.



Now I want to create a table and I want my table to be saved in a2.ndf file not a1. Is there a way to do things like this? I am using SQL Server.



Thanks.










share|improve this question

















  • 1




    The most that you can do is to control file growth on a1, so that once a1 is full, all new data goes into only a2. It would sort of be like "retiring" a1. But I'm not sure from your question if that is your intent. And this also carries the caveat that freeing up space from a1 would result in data being written there again.
    – mathewb
    1 hour ago
















up vote
3
down vote

favorite












I have a filegroup(not the primary one) which contains two different .ndf files, for example a1.ndf and a2.ndf.



Now I want to create a table and I want my table to be saved in a2.ndf file not a1. Is there a way to do things like this? I am using SQL Server.



Thanks.










share|improve this question

















  • 1




    The most that you can do is to control file growth on a1, so that once a1 is full, all new data goes into only a2. It would sort of be like "retiring" a1. But I'm not sure from your question if that is your intent. And this also carries the caveat that freeing up space from a1 would result in data being written there again.
    – mathewb
    1 hour ago












up vote
3
down vote

favorite









up vote
3
down vote

favorite











I have a filegroup(not the primary one) which contains two different .ndf files, for example a1.ndf and a2.ndf.



Now I want to create a table and I want my table to be saved in a2.ndf file not a1. Is there a way to do things like this? I am using SQL Server.



Thanks.










share|improve this question













I have a filegroup(not the primary one) which contains two different .ndf files, for example a1.ndf and a2.ndf.



Now I want to create a table and I want my table to be saved in a2.ndf file not a1. Is there a way to do things like this? I am using SQL Server.



Thanks.







sql-server filegroups






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 hours ago









Eleonora Grigoryan

38412




38412







  • 1




    The most that you can do is to control file growth on a1, so that once a1 is full, all new data goes into only a2. It would sort of be like "retiring" a1. But I'm not sure from your question if that is your intent. And this also carries the caveat that freeing up space from a1 would result in data being written there again.
    – mathewb
    1 hour ago












  • 1




    The most that you can do is to control file growth on a1, so that once a1 is full, all new data goes into only a2. It would sort of be like "retiring" a1. But I'm not sure from your question if that is your intent. And this also carries the caveat that freeing up space from a1 would result in data being written there again.
    – mathewb
    1 hour ago







1




1




The most that you can do is to control file growth on a1, so that once a1 is full, all new data goes into only a2. It would sort of be like "retiring" a1. But I'm not sure from your question if that is your intent. And this also carries the caveat that freeing up space from a1 would result in data being written there again.
– mathewb
1 hour ago




The most that you can do is to control file growth on a1, so that once a1 is full, all new data goes into only a2. It would sort of be like "retiring" a1. But I'm not sure from your question if that is your intent. And this also carries the caveat that freeing up space from a1 would result in data being written there again.
– mathewb
1 hour ago










1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










No, you can't specify the exact data file you want the data to go into.



What you can, though, is specify the filegroup at the table creation. If you want to fill in a big table on a specific disk drive, then you have to create a different filegroup, and create the table on that filegroup.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "182"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f219783%2fhow-to-specify-the-exact-ndf-file-on-a-filegroup-to-save-a-table-in%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote



    accepted










    No, you can't specify the exact data file you want the data to go into.



    What you can, though, is specify the filegroup at the table creation. If you want to fill in a big table on a specific disk drive, then you have to create a different filegroup, and create the table on that filegroup.






    share|improve this answer
























      up vote
      4
      down vote



      accepted










      No, you can't specify the exact data file you want the data to go into.



      What you can, though, is specify the filegroup at the table creation. If you want to fill in a big table on a specific disk drive, then you have to create a different filegroup, and create the table on that filegroup.






      share|improve this answer






















        up vote
        4
        down vote



        accepted







        up vote
        4
        down vote



        accepted






        No, you can't specify the exact data file you want the data to go into.



        What you can, though, is specify the filegroup at the table creation. If you want to fill in a big table on a specific disk drive, then you have to create a different filegroup, and create the table on that filegroup.






        share|improve this answer












        No, you can't specify the exact data file you want the data to go into.



        What you can, though, is specify the filegroup at the table creation. If you want to fill in a big table on a specific disk drive, then you have to create a different filegroup, and create the table on that filegroup.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 hours ago









        Marian

        12.9k13966




        12.9k13966



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f219783%2fhow-to-specify-the-exact-ndf-file-on-a-filegroup-to-save-a-table-in%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            Installing NextGIS Connect into QGIS 3?

            One-line joke