Syntax

ALTER SUBSCRIPTION subscription_name
    alter_option;

alter_option depends on the operation you want to perform on the subscription. For all supported clauses, see the sections below.

Clauses

OWNER TO

ALTER SUBSCRIPTION current_subscription_name
    OWNER TO new_user;
Parameter or clauseDescription
OWNER TOThis clause changes the owner of the subscription.
new_userThe new owner you want to assign to the subscription.
-- Change the owner of the subscription named "sub" to user "admin"
ALTER SUBSCRIPTION sub OWNER TO admin;

RENAME TO

ALTER SUBSCRIPTION subscription_name
    RENAME TO new_name;
Parameter or clauseDescription
RENAME TOThis clause changes the name of the subscription.
new_nameThe new name of the subscription.
-- Rename the subscription named "sub0" to "sub1"
ALTER SUBSCRIPTION sub0 RENAME TO sub1;

SET PARALLELISM

ALTER SUBSCRIPTION subscription_name
SET PARALLELISM = parallelism_number;
Parameter or clauseDescription
SET PARALLELISMThis clause controls the degree of parallelism for the targeted streaming job.
parallelism_numberThis parameter can be ADAPTIVE or a fixed number, like 1, 2, 3, etc. Altering the parameter to ADAPTIVE will expand the streaming job’s degree of parallelism to encompass all available units, whereas setting it to a fixed number will lock the job’s parallelism at that specific figure. Setting it to 0 is equivalent to ADAPTIVE.
-- Set the parallelism of the SUBSCRIPTION "s" to 4.
ALTER SUBSCRIPTION s SET PARALLELISM = 4;

SET SCHEMA

ALTER SUBSCRIPTION current_subscription_name
    SET SCHEMA schema_name;
Parameter or clauseDescription
SET SCHEMAThis clause moves the subscription to a different schema.
schema_nameThe name of the schema to which the subscription will be moved.
-- Move the subscription named "test_subscription" to the schema named "test_schema"
ALTER SUBSCRIPTION test_subscription SET SCHEMA test_schema;

SWAP WITH

ALTER SUBSCRIPTION name
SWAP WITH target_name;
ParameterDescription
nameThe current name of the subscription to swap.
target_nameThe target name of the subscription you want to swap with.
-- Swap the names of the user_updates subscription and the admin_updates subscription.
ALTER SUBSCRIPTION user_updates
SWAP WITH admin_updates;