IF  OBJECT_ID('PK_ABREV') IS NULL
begin
	ALTER TABLE ABREV ALTER COLUMN sg_abrev varchar(50) NOT NULL
end
GO
IF (
SELECT K.TABLE_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS C
JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS K
ON C.TABLE_NAME = K.TABLE_NAME
AND C.CONSTRAINT_CATALOG = K.CONSTRAINT_CATALOG
AND C.CONSTRAINT_SCHEMA = K.CONSTRAINT_SCHEMA
AND C.CONSTRAINT_NAME = K.CONSTRAINT_NAME
WHERE C.CONSTRAINT_TYPE = 'PRIMARY KEY'
AND K.COLUMN_NAME = 'sg_abrev') is NULL
begin
	ALTER TABLE dbo.ABREV ADD CONSTRAINT
		PK_ABREV PRIMARY KEY CLUSTERED 
		(
		sg_abrev
		) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
end