As most people who work with Sql Server know, you can declare a temporary table like so:
create table #foo
(
row_id int identity not null primary ke
This is a non issue. Index names only have to be unique within a table scope, not globally across table scopes. Only constraint names have to be unique within an entire database schema.
So, for example, you can run this in multiple concurrent connections with no problems
CREATE TABLE #T
(
C INT
)
CREATE UNIQUE CLUSTERED INDEX ix on #T(C)
But this would fail under concurrency
ALTER TABLE #T
ADD CONSTRAINT UQ UNIQUE NONCLUSTERED (C)
Should be able to do:
CREATE INDEX #foo1 ON #foo(bar);