I have a situation where a DB has a single file, but for performance reasons we want to evenly distribute the data among four files. I ran across this SQL magazine article which states:
If you’d like to rebalance over a certain number of files, the easiest method is to create a new filegroup with the desired number of files, then rebuild indexes using CREATE INDEX … WITH (DROP_EXISTING=ON) plus specifying the new filegroup, and then drop the old filegroup. That unfortunately means you need to provision even more space (easier said than done) but it will do the trick. Note that this method won’t work if you have any LOB data, as that cannot be moved without creating a new table and exporting the data into it.
I'm not a T-SQL expert, so what I need are the complete list of T-SQL commands that will do the trick.
Thanks!
Article: http://sqlmag.com/blog/rebalancing-data-across-files-filegroup
Blog: www.derekseaman.com, VMware vExpert 2012/2013