Hi Shawn,
Thanks for your response. Apologies if unclear, the two ndf files are in the same filegroup;
USE [master] GO
CREATE DATABASE [SWTestFile2] ON PRIMARY ( NAME = N'SWTestFile', FILENAME = N'W:\MSSQL\SWTestFile2.mdf' , SIZE = 3MB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024MB ), FILEGROUP [SWTestFileFG] ( NAME = N'SWTestFile22', FILENAME = N'W:\MSSQL\SWTestFile22.ndf' , SIZE = 3MB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024MB ), ( NAME = N'SWTestFile23', FILENAME = N'W:\MSSQL\SWTestFile23.ndf' , SIZE = 3MB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024MB ) LOG ON ( NAME = N'SWTestFile2log', FILENAME = N'X:\MSSQL\SWTestFile2_log.ldf' , SIZE = 100MB , MAXSIZE = 2048GB , FILEGROWTH = 100MB ) GO
ALTER DATABASE [SWTestFile2] SET COMPATIBILITYLEVEL = 100 GO
ALTER DATABASE [SWTestFile_2] MODIFY FILEGROUP [SWTestFileFG] DEFAULT;
It is after this that I create a populate a table, that on running;
--now run after data population
SELECT FileId, BytesOnDisk FROM ::fnvirtualfilestats(dbid(), NULL) WHERE FileId <> 2 --2 being logfile
shows the first ndf with all the data in it and the second untouched.
Thanks ,
5 People are following this question.
Should I use a multibase differential backup or separate ones for each filegroup?
Is it good practise to use Primary filegroup for all purposes?
Can you do a SQL Server 2008 Filegroup backup redirected restore?
Get each file size inside a Folder using SQL
What to do after my sql server primary file group has reached 10gb?