Esempio n. 1
0
        /// <summary>
        /// Remove a database from a server
        /// </summary>
        /// <param name="databaseName">The name of the database to delete</param>
        public void RemoveDatabase(string databaseName)
        {
            this.clientRequestId = SqlDatabaseManagementHelper.GenerateClientTracingId();

            ISqlDatabaseManagement channel = GetManagementChannel();

            Database database = this.GetDatabase(databaseName);

            SqlDatabaseInput input = new SqlDatabaseInput();

            input.Name          = databaseName;
            input.Id            = database.Id.ToString();
            input.CollationName = database.CollationName;
            input.Edition       = database.Edition.ToString();
            input.MaxSizeGB     = database.MaxSizeGB.ToString();

            channel.EndRemoveDatabase(
                channel.BeginRemoveDatabase(
                    this.subscriptionId,
                    this.serverName,
                    databaseName,
                    input,
                    null,
                    null));
        }