Otherwise, SQL
Server will place the object into the default filegroup. If you haven??™t created and specified
a default filegroup other than PRIMARY, the newly created object will end up in the PRIMARY
filegroup (which is generally not desirable). I do recommend that you use filegroups and
specify a filegroup other than PRIMARY as the default.
Creating an Object in a Filegroup
To specify a filegroup, you simply add an ON clause to the end of the CREATE statement:
CREATE TABLE AWNotes(
[ID] INT,
[Notes] TEXT)
ON AWSampleData
In addition to placing tables and indexes on specific filegroups, you can specify a
separate filegroup to hold any data for columns of type TEXT, NTEXT, or IMAGE. You set such
a filegroup on a table-by-table basis. As you might expect, SQL Server uses the default
filegroup for text and image data if no other filegroup is specified.
Assigning specific filegroups when creating a table with SQL Server Management
Studio is not intuitive. The Properties window must be open when creating a table, as
shown in Figure 4-4.
CHAPTER 4 n BACKING UP AND RESTORING FILES AND FILEGROUPS 81
Figure 4-4.
Pages:
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181