SQL Server – How to Specify the Exact .ndf File on a Filegroup to Save a Table

filegroupssql server

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.

Best 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.