Share via


Windows-based Hosting::ModifyCustomerDatabaseFile

This procedure modifies settings for a specified database.

T-SQL Issues

There are T-SQL issues when modifying database attributes with the ModifyDatabaseFile method.

In SQL Server 2005 Standard Edition with SP2, T-SQL calls that alter the file growth size to unrealistic numbers, such as growing the log file of the database by 3TB, will result in a log file growth of 1MB. This is an inconsistency of the SQL Server since the SQL Admin Provider is merely passing through the statements to the server. Also, this is not an API issue, rather it is the result of the server not processing the "corrupt" value.

Values of file growth size over 1 TB will not generate an error message, but rather will report a completed transaction and leave the log file growth at the default of 1MB.

Arguments

Input Arguments Description

<orgLdapPath>

The Lightweight Directory Access Protocol (LDAP) path of the owning organization.

<databaseName>

The name of the database to be modified.

<preferredDomainController>

<logicalName>

Logical name of the file.

<megabytes>

The size to be allocated to the resource.

<sendCredentials>

<sqlUserName>

User name for connecting to the SQL Server via SQL Authentication. If this node is present, the connection will be made via SQL Authentication rather than Windows Authentication. The existence of this node also requires that the <sqlUserPass/> node exist.

<sqlUserPass>

The password for connecting to the SQL Server via SQL Authentication, using the username indicated by <sqlUserName/>. If the <sqlUserName/> node is not present, this node is ignored.

Remarks

Method Syntax

public string   ModifyCustomerDatabaseFile( 
                                        string orgLdapPath,  
                                        string databaseName,  
                                        string preferredDomainController, 
                                        string logicalName, 
                                        string sqlUserName,  
                                        string sqlUserPass, 
                                        string megabytes, 
                                        bool sendCredentials) 

Sample Code

Example XML Request

No example XML request.

Example XML Response

<response> 
  <data> 
    <orgLdapPath>LDAP://OU=WingTipToys,OU=consolidatedmessenger,OU=Hosting,DC=fabrikam,DC=Com</orgLdapPath> 
    <databaseName>Impl1</databaseName> 
    <preferredDomainController>AD01-wh.fabrikam.com</preferredDomainController> 
    <logicalName>dataFiles</logicalName> 
    <fileMaxSize>300MB</fileMaxSize> 
    <fileGrowth>20MB</fileGrowth> 
  </data> 
</response> 

Typical C# Usage

//Get user name and password.                            
        string userName = this.Request.ServerVariables.Get("AUTH_USER"); 
        string pass = this.Request.ServerVariables.Get("AUTH_PASSWORD"); 
 
        //Set credentials.       
        objWS.PreAuthenticate = true; 
        objWS.Credentials = new NetworkCredential(userName,pass); 
        lblMsg.InnerHtml = mpsResponseHeaderLabel; 
 
        //Display response. 
        this.mpsResponse.DocumentSource = ""; 
        response = objWS.ModifyDatabaseSize(orgLdapPath, databaseName,  preferredDomainController, fileSize, fileGrowth, fileMaxSize,  newLogicalName, logicalName, sqlUserName, sqlUserPass, true); 
 
        // set the response XML to match the return from MPF 
        responseXml.LoadXml(response); 
        this.mpsResponse.Document = responseXml; 

Applies To

Managed Windows-based Hosting Web Service for:

  • Hosted Messaging and Collaboration version 3.5

  • Hosted Messaging and Collaboration version 3.0

  • Windows-based Hosting version 4.5

  • Windows-based Hosting version 4.0

  • Windows-based Hosting version 3.5

  • Windows-based Hosting for Applications version 1.0

See also

Tasks

Windows-based Hosting::CreateCustomerDatabase
Windows-based Hosting::DeleteCustomerDatabase