I'm trying to optimize a procedure that has code like the following:
CREATE TABLE #t1 (c1 int, c2 varchar(20), c3(varchar(50)...)
CREATE CLUSTERED INDEX ix_t1 ON #t1(c3) ON [PRIMARY]
CREATE TABLE #t1 (c1 int, c2 varchar(20), c3 varchar(50)..., UNIQUE CLUSTERED (c3))
No there is not...the existence of the ability to define clustered as an option in table creation is to support declaring primary key and unique column constraints, which themselves create indexes. In other words,
CLUSTERED in the
CREATE TABLE statement is specifying whether or not the index created by the
UNIQUE constraint should be clustered or nonclustered, which is important because a table can only have one clustered index.