Skip to main content

Remove a Server-Wide Connection String

  • Use RemoveServerWideConnectionStringOperation to remove a server-wide connection string from the cluster.

  • Removing a server-wide connection string deletes both:

    • The cluster-level definition.
    • The propagated connection string entries from all databases that received it.
  • A server-wide connection string cannot be removed while it is still used by an ongoing task or AI agent in any database. Before removing it, delete or update the tasks and AI agents that reference it.

  • To remove a server-wide connection string from Studio, open Manage Server > Server-Wide Connection Strings
    and use the delete action in the list view. See Managing server-wide connection strings.

  • In this article:

Remove a server-wide connection string

The following example removes a RavenDB server-wide connection string.
Only the Name property is required; the type is inferred from the connection string class.

var ravenConnectionString = new RavenConnectionString()
{
// Only the 'Name' property is needed for the remove operation.
Name = "ravendb-connection-string-name"
};

// Define the remove operation, pass the connection string to be removed.
var removeOp =
new RemoveServerWideConnectionStringOperation<RavenConnectionString>(ravenConnectionString);

// Execute the operation through the server maintenance store.
RemoveServerWideConnectionStringResult result = store.Maintenance.Server.Send(removeOp);

Syntax

public RemoveServerWideConnectionStringOperation(T connectionString) where T : ConnectionString

ParameterTypeDescription
connectionStringTConnection string to remove (only Name is required):
RavenConnectionString
SqlConnectionString
SnowflakeConnectionString
OlapConnectionString
ElasticSearchConnectionString
QueueConnectionString
AiConnectionString
Operation result
RemoveServerWideConnectionStringResultContains RaftCommandIndex - the Raft index assigned to the operation.