Generates the CREATE PROCEDURE statement to create a custom stored procedure.
sp_scriptdelproc [@artid =] artid
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.
sp_scriptdelproc is used in transactional replication.
Members of the public role can execute sp_scriptdelproc.
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.
sp_scriptinsproc | sp_scriptmappedupdproc |
sp_scriptupdproc | System Stored Procedures |