lidong
lidong

Reputation: 608

SQL Server only loads data into one of the files in a filegroup

I have 3 files in filegroup PRIMARY, and when I bulkcopy, it always inserts the data into just one of the files--and it is the same file every time. The other two files are always empty. Did I miss anything?

SQL Server 2016 version: 13.0.1601.5

Upvotes: 1

Views: 78

Answers (1)

Alexander Volok
Alexander Volok

Reputation: 5940

I assume you see this by the growth of files. This can be adjusted by a new database-scoped setting:

ALTER DATABASE YourDb
MODIFY FILEGROUP [PRIMARY] AUTOGROW_ALL_FILES
GO

The same thing can be achieved on an instance level via trace flag:

DBCC TRACEON(1117,-1)

Worth to mention that trace flag approach available in older versions..

Extra reference:

Upvotes: 1

Related Questions