IF NOT EXISTS (SELECT 1 FROM SYS.COLUMNS WHERE NAME = 'TERMINAL_PDV' and object_id = object_id('POS_CONNECT_TERMINAL'))
BEGIN
	ALTER TABLE POS_CONNECT_TERMINAL ADD TERMINAL_PDV int NULL;
END


IF NOT EXISTS (SELECT 1 FROM SYS.COLUMNS WHERE NAME = 'CD_CTR' and object_id = object_id('POS_CONNECT_TERMINAL'))
BEGIN
	ALTER TABLE POS_CONNECT_TERMINAL ADD CD_CTR int IDENTITY(0,1) NOT NULL;
END



if exists(select 1 from sys.objects where object_id = object_id('POS_CONNECT_TERMINAL_PK') )
BEGIN


ALTER TABLE POS_CONNECT_TERMINAL ADD CONSTRAINT POS_CONNECT_TERMINAL_PK PRIMARY KEY (CD_CTR);

END	
