Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

Primary key generates sequentially or non-sequentially in SQL server?

Interviewer asked me this interesting question in SQL server section, still I am not able to understand and find solution.

I requested interviewer to elaborate more on this question then he replied is there any constraint to add primary key in SQL table with sequence or not. 

 

Answers


Primary keys must contain UNIQUE values, and cannot contain NULL values that is important first, now question is whether it store PK value sequential order or not then my answer is it depends on which RDBMS you are using.

SQL server clustered index increases data in sequence and in SQL server primary key number/int value increases in sequential order. 

Share your answer


Share as a guest

Please subscribe me to the CodeChef4U.

By creating your new answer, you agree to the privacy policy and terms of service.