共用方式為


FileGroups Collection

未來的 Microsoft SQL Server 發行版本將不再提供此功能。請避免在新的開發工作中使用此功能,並計劃修改目前使用此功能的應用程式。

The FileGroups collection contains FileGroup objects that reference the filegroups of a Microsoft SQL Server database.

顯示目前物件的 SQL-DMO 物件模型

Properties

Count Property

Methods

Add Method

Refresh Method

Item Method

Remove Method (Collections)

ItemByID Method

 

備註

SQL Server filegroups can be used to associate the operating system files used to maintain database data. Filegroups can simplify administrative tasks such as backup and restore operations. By default, a SQL Server database is created on exactly one filegroup called PRIMARY.

With the FileGroups collection, you can:

  • Create a new SQL Server filegroup.
  • Remove a SQL Server filegroup.

When using the Item or Remove method, the FileGroups collection supports member identification using either name or ordinal reference syntax. For example:

Set oFileGroup = oDatabase.FileGroups("PRIMARY")

Or

Set oFileGroup = oDatabase.FileGroups(1)
ms138080.note(zh-tw,SQL.90).gif附註:
Using the FileGroups collection to create or remove SQL Server database filegroups requires appropriate privilege. The SQL Server login used for SQLServer object connection must be a member of one of the fixed roles sysadmin or diskadmin.