Add new comment

SQL 2016 improvements

From SQL 2016 onward it's possible to do the following, so you don't get the issue with a composite primary key:

CREATE TABLE #temp_table (
   id1 int NOT NULL,
   id2 int NOT NULL,
   name nvarchar(100),
   PRIMARY KEY (id1, id2)
)