CREATE TABLE #t
(
c1 int
)
GO
CREATE INDEX IX_c1 ON #t(c1)
GO
SELECT
[object_id], [name]
FROM
tempdb.sys.indexes
WHERE
[object_id] = OBJECT_ID('tempdb.dbo.#t') AND
type > 0
DROP TABLE #t
GO
object_id name
----------- -------
389576426 IX_c1
(1 row(s) affected)