Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSrepl_checkdatatypemapping

  No additional text.


Syntax


-- Name:
--		sp_MSrepl_checkdatatypemapping

-- Description:
--		Verify if a data type mapping exists or not

-- Returns:
--		0 if successful
--		1 if failed

-- Security:
--		Internal


CREATE PROCEDURE sys.sp_MSrepl_checkdatatypemapping
(
	@source_dbms			sysname,
	@source_version			varchar(10)	= NULL,
	@source_type			sysname,
	@source_length			bigint		= NULL,
	@source_precision		int			= NULL,
	@source_scale			int			= NULL,
	@source_nullable		bit			= 1,
	@destination_dbms		sysname,
	@destination_version	varchar(10) = NULL,
	@destination_type		sysname,
	@destination_length		bigint		= NULL,
	@destination_precision	int			= NULL,
	@destination_scale		int			= NULL,
	@destination_nullable	bit			= 1
)
AS
BEGIN
	DECLARE @retcode				int
	
    SET NOCOUNT ON
	set @retcode = 0

	
    -- Security Check: require sysadmin
	
    IF (ISNULL(IS_SRVROLEMEMBER('sysadmin'),0) = 0)
    BEGIN
        RAISERROR(21089,16,-1)
        RETURN (1)
    END

	-- Get list of matching mappings
	IF NOT EXISTS
	(
		SELECT	*
		FROM	sys.fn_MSrepl_getdatatypemappings
			(
				@source_dbms,
				@source_version,
				@source_type,
				@source_length,
				@source_precision,
				@source_scale,
				@source_nullable,
				@destination_dbms,
				@destination_version,
				0,
				NULL
			)
		WHERE	destination_type		= @destination_type
		  AND	(
		  			(destination_length IS NULL AND @destination_length IS NULL) OR
					(destination_length = @destination_length)
				)
		  AND	(
		  			(destination_precision IS NULL AND @destination_precision IS NULL) OR
					(destination_precision = @destination_precision)
				)
		  AND	(
		  			(destination_scale IS NULL AND @destination_scale IS NULL) OR
					(destination_scale = @destination_scale)
				)
		  AND	destination_nullable	= @destination_nullable
	)
    BEGIN
    	IF @destination_type IS NULL
    	BEGIN
    		RAISERROR(21779, 16, -1, @source_type)
    	END
    	ELSE
    	BEGIN
        	RAISERROR(21770, 16, -1, @source_type, @destination_type)
        END

		RETURN (1)
	END
	
	RETURN (0)
END

 
Last revision 2008RTM
See also

  sp_MSdrop_replcom (Procedure)
sp_MSrepl_changearticlecolumndatatype (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