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

Primary key and Primary index on a same column - response (1) by chinmay Athavale

$
0
0

Hello Sachin,
When you specify Primary Kay keyword inside create table, Teradata will be default consider as a Unique Primary Index.
So in addition, if you specify another non unique primary index on same column, it will throw an error.
In your case, since name is already being considered as an UPI candidate, you can not define NUPI on same name column.
Executing below sql ddl will create name as an UPI:

CREATETABLEtemp4243426

(

  

nameINTNOTNULL,

name2 INTNOTNULL,

PRIMARYKEY(name)

)
Regards,
Chinmay Athavale


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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