Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSrepl_fixupdefaultmappings

  No additional text.


Syntax


-- Name:
--		sp_MSrepl_fixupdefaultmappings

-- Description:
--		Prune any dead map entries (no data type mappings)
--		Restore defaults for any empty default mapping entries

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

-- Security:
--		Internal

-- Notes:
--		Used to clean up after dropping data type mappings
--		NOTE: Caller is assumed to manage transaction


CREATE PROCEDURE sys.sp_MSrepl_fixupdefaultmappings
AS
BEGIN
    SET NOCOUNT ON

	-- Delete any dead maps
	DELETE FROM msdb.dbo.MSdbms_map
	WHERE	map_id NOT IN
				(
					SELECT	distinct map_id
					FROM	msdb.dbo.MSdbms_datatype_mapping
				)
	
	IF @@ERROR <> 0
	BEGIN
		RETURN (1)
	END
	
	-- Reset null default mappings
	UPDATE	msdb.dbo.MSdbms_map
	SET		default_datatype_mapping_id = dm.datatype_mapping_id
	FROM	msdb.dbo.MSdbms_map map,
			msdb.dbo.MSdbms_datatype_mapping dm
	WHERE	map.map_id = dm.map_id
	  AND	map.default_datatype_mapping_id IS NULL

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

 
Last revision 2008RTM
See also

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