Udostępnij za pośrednictwem


InstanceDatabaseLogFile Constructor (InstanceDatabaseOptions, String)

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

Namespace: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
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
)

Parameters

  • 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.

Remarks

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.

Example

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)

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

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

Other Resources

CREATE DATABASE (Transact-SQL)
Defining the Instance Database
LogFile Element (ICF)