How to set Primary Key constraints on multiple columns in a table in SQL Server?
How to set Primary Key constraints on multiple columns in a table in SQL Server?
I completed my post-graduation in 2013 in the engineering field. Engineering is the application of science and math to solve problems. Engineers figure out how things work and find practical uses for scientific discoveries. Scientists and inventors often get the credit for innovations that advance the human condition, but it is engineers who are instrumental in making those innovations available to the world. I love pet animals such as dogs, cats, etc.
Ashutosh Kumar Verma
08-Nov-2021Set multiple columns as Primary Key in a table :
Generally we have to set a primary key on single column in a table, but if we have need to create more than one columns as primary key then we can use the following SQL Statement,
1- when table is created
2- If there is no column is set as primary key in created table and we have need to set two or more columns set as primary key then use the following SQL Statement.