MD3.PrimaryKeys.sql 677 Bytes
Newer Older
dwentzel's avatar
dwentzel committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
IF NOT EXISTS (SELECT 1 FROM sys.objects
					 WHERE type ='u' AND object_id = OBJECT_ID('MD3.PrimaryKeys'))
BEGIN
	
	CREATE TABLE MD3.PrimaryKeys
	   (Id              BIGINT IDENTITY(1,1) NOT NULL,
	SchemaName VARCHAR(256) NOT NULL,
	TableName VARCHAR(256) NOT NULL,
	PrimaryKeyName	SYSNAME NOT NULL,    
	KeyColumns VARCHAR(MAX) NOT NULL,
    IsClustered	BIT NOT NULL,  
	IdxFillFactor int NOT NULL,
	IsPadded BIT NOT NULL,
    FGorPartitionScheme VARCHAR(MAX) NOT NULL,
	CompressionSetting varchar(255) NOT NULL,
	DropPK BIT NOT NULL
	);
	   
	ALTER TABLE MD3.PrimaryKeys ADD CONSTRAINT PrimaryKeysPK 
	PRIMARY KEY CLUSTERED (Id);
		
END 
--drop table MD3.PrimaryKeys