Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_IHCheckSourceTable

  No additional text.


Syntax


-- Name:
--		sp_IHCheckSourceTable

-- Description:
--		Verify source table for publishing

-- Inputs:
--		@publisher_type		== publisher type
--		@publisher			== publisher name
--		@source_table		== source table
--		@source_owner		== source table owner
--		@publication_type	== publication type (tran == 0; snapshot == 1)

-- Returns:
--		Return code (0 for success, 1 for failure)

-- Security:
--		Internal

-- Notes:
--		Used by sp_addarticle to verify a HREPL source table


CREATE PROCEDURE sys.sp_IHCheckSourceTable
(
	@publisher_type		sysname,
	@publisher			sysname,
	@source_table		sysname,
	@source_owner		sysname,
	@publication_type	int
)
AS
BEGIN
	DECLARE @retcode	int
	DECLARE @index		int

    /*
    ** Parameter Check: @publisher.
    ** The @servername name cannot be NULL and must conform to the rules
    ** for identifiers.
    */
    IF @publisher IS NULL
    BEGIN
        RAISERROR (14043, 16, -1, '@publisher', 'sp_IHCheckSourceTable')
        RETURN (1)
    END

    EXECUTE @retcode = dbo.sp_validname @publisher

    IF @retcode <> 0
    BEGIN
		RETURN (1)
	END

    /*
    ** Parameter Check: @source_table.
    ** The @source_table name cannot be NULL
    */
    IF @source_table IS NULL
    BEGIN
        RAISERROR (14043, 16, -1, '@source_table', 'sp_IHCheckSourceTable')
        RETURN (1)
    END

	-- these are valid special chars that we do not accept
	select @index = charindex( N'#', @source_table)
	if (@index <> 0)
	begin
		raiserror(15006,16,-1,@source_table)
		return (1)
	end
	
	select @index = charindex( N'!', @source_table)
	if (@index <> 0)
	begin
		raiserror(15006,16,-1,@source_table)
		return (1)
	end
		
    /*
    ** Parameter Check: @source_owner.
    ** The @source_owner name cannot be NULL
    */
    IF @source_owner IS NULL
    BEGIN
        RAISERROR (14043, 16, -1, '@source_owner', 'sp_IHCheckSourceTable')
        RETURN (1)
    END

	-- Check source for specific providers
	IF @publisher_type LIKE 'ORACLE%'
	BEGIN
		EXEC @retcode = sys.sp_ORACheckSourceTable
						@publisher			= @publisher,
						@source_table		= @source_table,
						@source_owner		= @source_owner,
						@publisher_type		= @publisher_type,
						@publication_type	= @publication_type
	END
	ELSE
	BEGIN
		RAISERROR (21643, 16, -1, '@publisher_type')
		RETURN (1)
	END

	RETURN (@retcode)
END

 
Last revision 2008RTM
See also

  sp_MSdrop_repltran (Procedure)
sp_MSrepl_addarticle (Procedure)
sp_ORACheckSourceTable (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