Jaa


ApplicationDatabaseLogFile Constructor (ApplicationDatabaseOptions, String)

Initializes a new instance of the ApplicationDatabaseLogFile class with a parent ApplicationDatabaseOptions object and a name.

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

Syntax

'Declaration
Public Sub New ( _
    applicationDatabaseOptions As ApplicationDatabaseOptions, _
    name As String _
)
public ApplicationDatabaseLogFile (
    ApplicationDatabaseOptions applicationDatabaseOptions,
    string name
)
public:
ApplicationDatabaseLogFile (
    ApplicationDatabaseOptions^ applicationDatabaseOptions, 
    String^ name
)
public ApplicationDatabaseLogFile (
    ApplicationDatabaseOptions applicationDatabaseOptions, 
    String name
)
public function ApplicationDatabaseLogFile (
    applicationDatabaseOptions : ApplicationDatabaseOptions, 
    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 application database after creating the application, use the Microsoft SQL Server tools, such as SQL Server Management Studio.

Remarks

Updated text:5 December 2005

You must set the FileName property. Other properties are optional.

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 the application database:

ApplicationDatabaseLogFile adb_log = 
    new ApplicationDatabaseLogFile(adb, "MyApp_LogFile1");
adb_log.FileName = @"C:\NS\Full\MyApp_LogFile1.ldf";
adb_log.InitialSize = "5MB";
adb_log.MaxSize = "20MB";
adb_log.GrowthIncrement = "10%";
adb.ApplicationDatabaseLogFiles.Add(adb_log);
Dim adb_log As ApplicationDatabaseLogFile = _
    New ApplicationDatabaseLogFile(adb, "MyApp_LogFile1")
adb_log.FileName = "C:\NS\Full\MyApp_LogFile1.ldf"
adb_log.InitialSize = "5MB"
adb_log.MaxSize = "20MB"
adb_log.GrowthIncrement = "10%"
adb.ApplicationDatabaseLogFiles.Add(adb_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

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

Other Resources

CREATE DATABASE (Transact-SQL)
Defining the Application Database
LogFile Element (ADF)