Chapter 18. Command Reference for Adaptive Server Enterprise

 

 

 

sp_add_article_col procedure

Purpose

To add a column to an article in a publication.

Syntax

sp_add_article_col publication_name,

 

table_name,

 

 

 

 

column_name

 

 

 

 

Argument

 

Description

 

 

 

 

 

 

 

 

publication_name

 

The name of the publication to which the article is to

 

 

 

be added.

 

table_name

 

The table containing the article.

 

column_name

 

The column to be added to the article in a publication

 

 

 

 

 

See also

Description

Example

“sp_add_article procedure” on page 381

“sp_remove_article procedure” on page 428

“ALTER PUBLICATION statement” [ASA SQL Reference, page 280]

Running sp_add_article_col adds a column to an article in a publication. The table must first be added to the publication using the “sp_add_article procedure” on page 381 .

To add all the columns of a table to a publication you do not need to use sp_add_article_col; just call sp_add_article.

To add only some of the columns of a table to a publication you first call sp_add_article, and then call sp_add_article_col for each of the columns you wish to include in the publication.

As with other data definition changes, in a production environment this procedure should only be run on a quiet SQL Remote installation.

For more information on the requirements for a quiet system, see “Making schema changes” on page 275 .

The following statements add the emp_id and emp_lname columns of the employee table to a publication named Personnel:

sp_add_article ’Personnel’, employee’

sp_add_article_col ’Personnel’, ’employee’, ’emp_id’ sp_add_article_col ’Personnel’, ’employee’, ’emp_lname’ go

383

Page 401
Image 401
Sybase DC38133-01-0902-01 manual Spaddarticlecol procedure, To add a column to an article in a publication