Generates the CREATE PROCEDURE statement to create a custom stored procedure.
sp_scriptinsproc [@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_scriptinsproc is used in transactional replication.
Members of the public role can execute sp_scriptinsproc.
This example creates an article (with artid set to 1) on the authors table in the pubs database and specifies the INSERT statement to be the custom procedure to execute.
'CALL sp_ins_authors'
The custom stored procedures to be executed by the Distribution Agent at the Subscriber are generated by running this stored procedure at the Publisher.
EXEC sp_scriptinsproc @artid = 1
This statement returns:
CREATE PROCEDURE [sp_ins_authors] @c1 varchar(11),@c2 varchar(40),
@c3 varchar(20),@c4 char(12),@c5 varchar(40),@c6 varchar(20),
@c7 char(2),@c8 char(5),@c9 bit
AS
INSERT INTO [authors] VALUES ( @c1,@c2,@c3,@c4,@c5,@c6,@c7,@c8,@c9 )
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_scriptdelproc | sp_scriptmappedupdproc |
sp_scriptupdproc | System Stored Procedures |