CREATE SUBSCRIPTION
TO pub_orders_samuel_singer
FOR SamS
Subscriptions with a
subscription expression Tosubscribe a user to a publication, if that publication does have a
subscriptionexpression, you need the following information:
UserID Theuser who is being subscribed to the publication. Thisuser
musthave been granted remote permissions.
Publicationname Thename of the publication to which the user is
beingsubscribed.
Subscriptionvalue Thevalue that is to be tested against the
subscriptionexpression of the publication. Forexample, if a publication
hasthe name of a column containing an employee ID as a subscription
expression,the value of the employee ID of the subscribing user must be
providedin the subscription. Thesubscription value is always a string.
Thefollowing statement creates a subscription for Samuel Singer (user ID
SamS,employee ID 856) to the pub_orders publication, defined with a
subscriptionexpression sales_rep, requesting the rows for Samuel Singer’s
ownsales:
CREATE SUBSCRIPTION
TO pub_orders ( ’856’ )
FOR SamS
Starting a subscription Inorder to receive and apply updates properly, each subscriber needs to have
aninitial copy of the data. Thesynchronization process is discussed in
“Synchronizingdatabases” on page 189.
Formore information, see “CREATE SUBSCRIPTION statement” on
page358.
140