PDA

View Full Version : سوال: Primary Key يا Unique



mj_developer
چهارشنبه 16 دی 1388, 14:59 عصر
سلام

در زمان ايجاد يك جدول با استفاده از كد مي توان گفت كه فلان ستون Primary Key و يا اينكه Unique باشد. فرق اين دو عملا در چيست؟


با تشكر

بهنام بهمنی
چهارشنبه 16 دی 1388, 16:40 عصر
Primary key:
1)Primary key is nothing but it is uniqly identified each roe in Table.
2)Primary key Does not Allowes Duplicate values and Null values.
3)Primary key is default Clustered indexes
4)One table can have only one Primary key.
Unique Key:
1)Unique Key is nothing but it is uniqly identified each roe in Table.
2)Unique Key Does not Allowes Duplicate values but allowes only one Null value.
3)Primary key is default Non- Clustered indexes


به گزينه هاي 3و4 در هر دو ليست بالا دقت شود.

mj_developer
چهارشنبه 16 دی 1388, 17:31 عصر
Primary key:
1)Primary key is nothing but it is uniqly identified each roe in Table.
2)Primary key Does not Allowes Duplicate values and Null values.
3)Primary key is default Clustered indexes
4)One table can have only one Primary key.
Unique Key:
1)Unique Key is nothing but it is uniqly identified each roe in Table.
2)Unique Key Does not Allowes Duplicate values but allowes only one Null value.
3)Primary key is default Non- Clustered indexes


به گزينه هاي 3و4 در هر دو ليست بالا دقت شود.



آيا دو جمله قرمز ضخيم با هم تناقض ندارند؟

sia_2007
چهارشنبه 16 دی 1388, 19:10 عصر
بله تناقض دارند؛ در آخرین خط منظور Unique بوده.