Dynamically name indexes in SQL Server 2005?
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);