Примечание.
Для доступа к этой странице требуется авторизация. Вы можете попробовать войти или изменить каталоги.
Для доступа к этой странице требуется авторизация. Вы можете попробовать изменить каталоги.
Initializes a new instance of the InstanceDatabaseFile class with a parent InstanceDatabaseFileGroup object and a name.
Пространство имен: Microsoft.SqlServer.Management.Nmo
Сборка: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
Синтаксис
'Декларация
Public Sub New ( _
instanceDatabaseFileGroup As InstanceDatabaseFileGroup, _
name As String _
)
public InstanceDatabaseFile (
InstanceDatabaseFileGroup instanceDatabaseFileGroup,
string name
)
public:
InstanceDatabaseFile (
InstanceDatabaseFileGroup^ instanceDatabaseFileGroup,
String^ name
)
public InstanceDatabaseFile (
InstanceDatabaseFileGroup instanceDatabaseFileGroup,
String name
)
public function InstanceDatabaseFile (
instanceDatabaseFileGroup : InstanceDatabaseFileGroup,
name : String
)
Параметры
- instanceDatabaseFileGroup
The parent InstanceDatabaseFileGroup object for the database file.
name
A String, between 1 and 128 characters in length, specifying the logical name of the data file.You cannot change the name. To alter an instance database after creating the instance, use the Microsoft SQL Server tools, such as SQL Server Management Studio.
Замечания
The name parameter specifies the logical name of the database data file. The logical name is used to refer to the file when managing the data file.
You must set the FileName property.
Пример
The following examples show how to define a data file for the instance database:
InstanceDatabaseFileGroup idb_fg =
new InstanceDatabaseFileGroup(idb, "PRIMARY");
idb.InstanceDatabaseFileGroups.Add(idb_fg);
// Define and add a data file
InstanceDatabaseFile idb_file1 =
new InstanceDatabaseFile(idb_fg, "MyInst_PrimaryFile1");
idb_file1.FileName = @"C:\NS\Full\MyInst_PrimaryFile1.mdf";
idb_file1.InitialSize = "5MB";
idb_file1.MaxSize = "15MB";
idb_file1.GrowthIncrement = "10%";
idb_fg.InstanceDatabaseFiles.Add(idb_file1);
' Define and add a filegroup
Dim idb_fg As InstanceDatabaseFileGroup = _
New InstanceDatabaseFileGroup(idb, "PRIMARY")
idb.InstanceDatabaseFileGroups.Add(idb_fg)
' Define and add a data file
Dim idb_file1 As InstanceDatabaseFile = _
New InstanceDatabaseFile(idb_fg, "MyInst_PrimaryFile1")
idb_file1.FileName = "C:\NS\Full\MyInst_PrimaryFile1.mdf"
idb_file1.InitialSize = "5MB"
idb_file1.MaxSize = "15MB"
idb_file1.GrowthIncrement = "10%"
idb_fg.InstanceDatabaseFiles.Add(idb_file1)
Платформы
Платформы разработки
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
Целевые платформы
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
См. также
Справочник
InstanceDatabaseFile Class
InstanceDatabaseFile Members
Microsoft.SqlServer.Management.Nmo Namespace
Другие ресурсы
Определение базы данных экземпляра
LogicalName Element for FileSpec (ICF)