Sql-server – Why is it important for every table to have a primary key

primary-keysql server

So I have some tables in Sql Server that are essentially a list of sales, things like:

ProductID 
SalesOrderID
ProductFamilyID 
ProductCost
ProductSource

and so on. In this case, none of the columns are necessarily unique, so I can't create a primary key from any combination of them. In fact, the only constraint that I really have on the table is that I need every row in the table to be a unique combination of the columns. So I'm assuming something like a unique index would be the way to go there.

The only primary key I could add is something like an autoincrement primary key. But what would be the actual use of that, database wise? What are the possible problems with not creating a primary key for a table like this?

Best Answer

The big benefit is that the key is very narrow and naturally in order. Every non-clustered index you add by definition also contains the primary key in order to do look ups. So even though it doesn't appear to have much benefit, using an identity column as a PK would still be helpful.

Also, if you ever expand on to this and add other tables that need to reference this table, you just need the one column for the foreign key.