Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Dropping Primary Composite Key - response (3) by VandeBergB

$
0
0
Primary Keys and USI's are different animals if you try to run the DDL below code, it fails with "More than one primary index of primary key specified".  Teradata will create a Unique Primary Index on the table consisting of (col1,col2) if you remove the Primary Index specification for this DDL.  You can't do both.  You will only get "Primary Key" or "Primary Index" if the columns are different. Teradata won't create Primary Keys as USI's, you have to specify the USI in a create index statement, which is commonly done to maintain uniqueness on the table when the primary access columns differ from the columns that define uniqueness. CREATE TABLE dbname.pk_test , NO BEFORE JOURNAL, NO AFTER JOURNAL, NO FALLBACK, CHECKSUM = DEFAULT (col1 INTEGER NOT NULL PRIMARY KEY ,col2 INTEGER NOT NULL PRIMARY KEY ,col3 INTEGER NOT NULL ) PRIMARY INDEX (col3);

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>