Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSdrop_repl_job

  No additional text.


Syntax

-- Name:
--		sp_MSdrop_repl_job

-- Description:
--		This procedure should be used to drop replication jobs.
--		Here we validate that the job being dropped is replication
--		related and in certain cases we check to see if the current
--		user is a sysadmin or that the current database context is
--		the same as the on used when creating the job. We also check
--		to ensure that the job exists. If it does not exist we exit
-- 		without failure.

-- Parameters:
--		See definition

-- Returns:
--		0 - succeeded
--      1 - failed

-- Result:
--		None

-- Security:
--		Procedure is NOT PUBLIC so there are no security checks.
--		We do however ensure that the job being dropped is replication
--		related. In certain jobs we also ensure that the user is sysadmin
--		or that the current database context is the same as the on used
--		when creating the job.

CREATE PROCEDURE sys.sp_MSdrop_repl_job
(
	@job_name		sysname 			= NULL,
	@job_id 		binary(16) 			= NULL,
	@job_step_uid	uniqueidentifier 	= NULL
)
AS
BEGIN
	DECLARE @retcode 	int,
			@job_found 	bit

	SELECT @job_found = 0

	EXEC @retcode = sys.sp_MSrepl_check_job_access @id 				= @job_id,
													@step_uid		= @job_step_uid,
													@name			= @job_name,
													@err_not_found 	= 0,
													@job_found		= @job_found output
	IF @@ERROR <> 0 or @retcode <> 0
	BEGIN
		RETURN 1
	END

	-- we exit without failure if the job was not found
	IF @job_found = 0
	BEGIN
		RETURN 0
	END

	-- call internal drop procedure
	EXEC @retcode = sys.sp_MSdrop_repl_job_unsafe @job_name = @job_name,
													@job_id = @job_id,
													@job_step_uid = @job_step_uid
	
	RETURN @retcode
END

 
Last revision 2008RTM
See also

  sp_adddistributiondb (Procedure)
sp_dropdistributiondb (Procedure)
sp_dropmergepullsubscription (Procedure)
sp_droppullsubscription (Procedure)
sp_MSaddmergedynamicsnapshotjob (Procedure)
sp_MSadd_distributor_alerts_and_responses (Procedure)
sp_MScreate_replication_checkup_agent (Procedure)
sp_MSdistpublisher_cleanup (Procedure)
sp_MSdrop_distribution_agent (Procedure)
sp_MSdrop_distributor_alerts_and_responses (Procedure)
sp_MSdrop_dynamic_snapshot_agent (Procedure)
sp_MSdrop_logreader_agent (Procedure)
sp_MSdrop_merge_agent (Procedure)
sp_MSdrop_merge_agentid (Procedure)
sp_MSdrop_qreader_agent (Procedure)
sp_MSdrop_repl_job_unsafe (Procedure)
sp_MSdrop_snapshot_agent (Procedure)
sp_MSremovedbreplication (Procedure)
sp_MSrepl_drop_expired_sub_cleanup_job (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash