Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_IHisallreplcolpk

  No additional text.


Syntax


-- Name:
--          sp_IHisallreplcolpk

-- Description:
--          Query to see if all replicated columns are in the primary key

-- Security:
--          Internal

-- Returns:
--          1 == all columns in the primary key
--			0 == all columns are not in the primary key

-- Owner:
--          

create procedure sys.sp_IHisallreplcolpk
(
	@artid int
)
as
begin
    declare @pkcount  int
    declare @colcount int

    SELECT	@colcount = COUNT(*)
    FROM	IHcolumns
    WHERE	@artid = article_id

    SELECT	@pkcount = COUNT(*)
    FROM	IHcolumns ihc,
			IHpublishercolumns ihpc,
			IHpublishercolumnconstraints ihpcc,
			IHpublisherconstraints ihpcn,
			IHarticles iha
    WHERE	ihpcn.publisher_id				= iha.publisher_id
      and	ihpcn.table_id					= iha.table_id
      and	ihc.publishercolumn_id			= ihpc.publishercolumn_id
      and	ihpc.publishercolumn_id			= ihpcc.publishercolumn_id
      and	ihpcn.publisherconstraint_id	= ihpcc.publisherconstraint_id
      and	iha.article_id					= @artid
      and	ihpcn.type						= 'PRIMARYKEY'

    if @pkcount = @colcount
		return 1
    else
		return 0
end

 
Last revision 2008RTM
See also

  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