Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSclearcolumnbit

  No additional text.


Syntax
create procedure sys.sp_MSclearcolumnbit
@pubid			uniqueidentifier,
@artid			uniqueidentifier,
@column_name	sysname
as

declare @tablename		sysname
declare @colid			int
declare @in_use			bit
declare @objid			int
declare @columns		varbinary(128)
declare @local_repid	uniqueidentifier
declare @publish		int
declare @qual_name		nvarchar(517)
set nocount on

set @publish		= 0x4000
set @in_use=0
set @local_repid	= NULL

-- Security Checking
-- sysadmin or db_owner or replication agent have access

if ({fn ISPALUSER(@pubid)} <> 1)
	if is_member ('db_ddladmin') <>1
	begin
		raiserror(14260, 16, -1)
		return (1)
	end

select @tablename = object_name(objid), @objid=objid from dbo.sysmergearticles where artid=@artid and pubid=@pubid

select @colid=column_id from sys.columns where object_id=@objid and name=@column_name

select top 1 @local_repid=pubid from dbo.sysmergearticles where artid=@artid and pubid<>@pubid order by pubid ASC
begin tran
save tran sp_MSclearcolumnbit

-- Acquire exclusive lock for subsequent system object updates
exec sys.sp_MSget_qualified_name @objid, @qual_name OUTPUT

exec %%Object(MultiName=@qual_name).LockMatchID(ID=@objid, Exclusive = 1, BindInternal = 0)
--exec %%Object(MultiName=@qual_name).LockExclusiveMatchID(ID=@objid)
if @@error<>0
	goto FAILURE

if @local_repid is NULL
begin
	exec %%ColumnEx(ObjectID=@objid,Name=@column_name).SetMergePublished(Value=0)
	if @@ERROR<>0
		goto FAILURE
	commit tran
	return (0)
end
while @local_repid is not NULL and @in_use=0
begin
	select @columns = columns from dbo.sysmergearticles where pubid=@local_repid and artid=@artid
	exec @in_use = sys.sp_MStestbit @bm=@columns, @coltotest=@colid
	set @local_repid	= NULL
	select top 1 @local_repid=pubid from dbo.sysmergearticles where artid=@artid and pubid>@local_repid order by pubid ASC
end
if @in_use=0
begin
	exec %%ColumnEx(ObjectID=@objid,Name=@column_name).SetMergePublished(Value=0)
	if @@ERROR<>0
		goto FAILURE
end
commit tran
return (0)

FAILURE:
	rollback tran sp_MSclearcolumnbit
	commit tran
	return (1)

 
Last revision 2008RTM
See also

  sp_mergearticlecolumn (Procedure)
sp_MSdrop_rladmin (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