共用方式為


InstanceDatabaseLogFile Constructor (InstanceDatabaseOptions, String)

Initializes a new instance of the InstanceDatabaseLogFile class with a parent InstanceDatabaseOptions object and a name.

命名空間: Microsoft.SqlServer.Management.Nmo
組件: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

語法

'宣告
Public Sub New ( _
    instanceDatabaseOptions As InstanceDatabaseOptions, _
    name As String _
)
public InstanceDatabaseLogFile (
    InstanceDatabaseOptions instanceDatabaseOptions,
    string name
)
public:
InstanceDatabaseLogFile (
    InstanceDatabaseOptions^ instanceDatabaseOptions, 
    String^ name
)
public InstanceDatabaseLogFile (
    InstanceDatabaseOptions instanceDatabaseOptions, 
    String name
)
public function InstanceDatabaseLogFile (
    instanceDatabaseOptions : InstanceDatabaseOptions, 
    name : String
)

參數

  • name
    A String, up to 128 characters in length, specifying the logical name of the log 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 logical name is used to refer to log file during any log management tasks. For more information, see the logical_file_name parameter in the CREATE DATABASE (Transact-SQL) topic.

範例

The following examples show how to define a log file for an instance database:

InstanceDatabaseLogFile idb_log = 
    new InstanceDatabaseLogFile(idb, "MyInst_LogFile1");
idb_log.FileName = @"C:\NS\Full\MyInst_LogFile1.ldf";
idb_log.InitialSize = "3MB";
idb_log.MaxSize = "10MB";
idb_log.GrowthIncrement = "10%";
idb.InstanceDatabaseLogFiles.Add(idb_log);
Dim idb_log As InstanceDatabaseLogFile = _
    New InstanceDatabaseLogFile(idb, "MyInst_LogFile1")
idb_log.FileName = "C:\NS\Full\MyInst_LogFile1.ldf"
idb_log.InitialSize = "3MB"
idb_log.MaxSize = "10MB"
idb_log.GrowthIncrement = "10%"
idb.InstanceDatabaseLogFiles.Add(idb_log)

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

InstanceDatabaseLogFile Class
InstanceDatabaseLogFile Members
Microsoft.SqlServer.Management.Nmo Namespace

其他資源

CREATE DATABASE (Transact-SQL)
定義執行個體資料庫
LogFile Element (ICF)