Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 608
  • Last Modified:

Index Creation date

Can someone show me how to write a query or run a stored procedure that will let me know when an index has been created?

0
djadkison
Asked:
djadkison
  • 2
  • 2
1 Solution
 
David_CameronCommented:
I can't comment on 2K, but for SQL7 I don't think that you can get this information. SQL Server does not provide an audit trail for changes you make to structual parts of the database. I don't think that this has changed for SQL 2K. Check Books Online under the sysindexes entry.
0
 
hans_vdCommented:
Try this query:

SELECT u.name + '.' + o.name tablename,
       i.name index_name,
       o.crdate index_creation_date
FROM sysusers u JOIN
     sysobjects o ON u.uid=o.uid JOIN
     sysindexes i ON o.id=i.id
WHERE o.type='U'
  AND i.status & 64=0
  AND i.indid < 255
ORDER BY tablename, index_creation_date
0
 
djadkisonAuthor Commented:
The Creation date appears to be the date of creation for the table, not the index.   I appreciate the information. It is not apparently available.
0
 
hans_vdCommented:
Pffff, I'm really having a bad day today ...

I'm sorry.
0
 
djadkisonAuthor Commented:
That's okay. At least you tried to help. And for that matter, the code gave my DBA some other ideas.
Thanks again, Dave
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now