sp_scriptdelproc (T-SQL)

Generates the CREATE PROCEDURE statement to create a custom stored procedure.

Syntax

sp_scriptdelproc [@artid =] artid

Arguments
[@artid =] artid
Is the article ID. artid is int, with no default.
Result Sets

Returns a result set that consists of a single nvarchar(4000) column. The result set forms the complete CREATE PROCEDURE statement necessary to create the custom stored procedure.

Remarks

sp_scriptdelproc is used in transactional replication.

Permissions

Members of the public role can execute sp_scriptdelproc.

Examples

This example creates an article (with artid set to 1) on the authors table in the pubs database and specifies the DELETE statement to be the custom procedure to execute.

'CALL sp_del_authors'

  

The custom stored procedure to be executed by the Distribution Agent at the Subscriber is generated by running this stored procedure at the Publisher.

EXEC sp_scriptdelproc @artid = 1

  

The statement returns:

CREATE PROCEDURE [sp_del_authors] @pkc1 varchar(11)

AS

DELETE [authors]

WHERE [au_id] = @pkc1

  

This stored procedure can be used to generate custom stored procedures for manually synchronized articles or for articles for which the automatic generation of custom stored procedures has been disabled.

See Also
sp_scriptinsproc sp_scriptmappedupdproc
sp_scriptupdproc System Stored Procedures

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.