This can be done by adding an identity column, for example:
CREATE TABLE #t1 (rowID int not null identity(1,1), c1 int, c2 varchar(20), c3 varchar(50), UNIQUE CLUSTERED (c3,rowID) )
The inclusion of rowID in the index ensures that it is unique, even if c3 not.
You are checking the index created with:
EXEC tempdb.dbo.sp_helpindex '#t1'
source share