Click here to Skip to main content
15,903,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello guyzz

Is it possible to insert null value for primary key.
if yes then
plz help me to insert null value for primary key.
Posted
Comments
[no name] 11-Dec-11 3:38am    
May I know why you need this?

No.
"A table can have at most one primary key, but more than one unique key. A primary key is a combination of columns which uniquely specify a row. It is a special case of unique keys. One difference is that primary keys have an implicit NOT NULL constraint while unique keys do not."
 
Share this answer
 
Comments
Monjurul Habib 11-Dec-11 3:57am    
5!
Rubaba 11-Dec-11 6:25am    
5+
Quote:
A table can have only one PRIMARY KEY constraint, and a column that participates in the PRIMARY KEY constraint cannot accept null values. Because PRIMARY KEY constraints guarantee unique data, they are frequently defined on an identity column.

PRIMARY KEY Constraints[^]
 
Share this answer
 
Comments
Monjurul Habib 11-Dec-11 3:57am    
5!
[no name] 11-Dec-11 4:12am    
Thanks Monjurul.
Rubaba 11-Dec-11 6:26am    
5+
[no name] 11-Dec-11 6:27am    
Thanks Rubaba
mhamad zarif 11-Dec-11 6:53am    
5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900