Wednesday, 15 July 2009

Adding, Dropping Column in SQL Server Replication Table

Objective: To modify the existing table structure in the replicated table

ALTER TABLE [dbo].[T_TableName] drop CONSTRAINT [Constraintname] DEFAULT ((0)) FOR [ColumnName]
GO
Exec sp_repldropcolumn @source_object = 'T_TableName'
, @column = 'ColumnName'
GO
Exec sp_repladdcolumn @source_object = 'T_TableName'
, @column = 'ColumnName'
, @typetext = 'Bit Not Null CONSTRAINT constraintName DEFAULT (0)'
, @publication_to_add = 'All' -- This indicates whichever publication holds this table, will modify.

Disabling - Shut Down Option

Objective: To avoid shut down from the Start Menu

Hive: HKEY_LOCAL_MACHINE
Key: Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Name: NoClose
Type: REG_DWORD
Value: 1

You could still shutdown using the command line tool. This is just to avoid clicking shutdown, instead of Logoff.