When was index created sql server




















It will point to the table the index belongs to. The following test will demonstrate the point:. You should select from sys. But the main problem with indexes is that when we rebuild or reorganize indexes then the index creation date gets changed to the date when the index was last rebuilt or reorganized.

How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 10 years, 1 month ago. Active 1 year, 11 months ago. Viewed k times.

I am using this query This sample works just for one database. Scroll to the bottom of the post for more samples on other blogs! You going to have to ditch the DDL trigger to drop that table. The downside is that Event Notifications are a bit more complex to set up and manage.

Event Notifications use Service Broker, so you need to become comfortable with the different parts of Service Broker, and managing having it on. If you go the Event Notifications route, I highly recommend that you configure the Event Notifications in their own database, and record all the index changes there. Enabling Service Broker requires an exclusive database lock. Aaron Bertrand wrote a similar post on capturing index operations in this great article.

His sample DDL trigger is for all user databases and for create and alter events only, because he was looking for any index rebuild operations per the question. The following statement finds the customer whose last name is Berg and first name is Monika :. When you create a nonclustered index that consists of multiple columns, the order of the columns in the index is very important.

You should place the columns that you often use to query data at the beginning of the column list. For example, the following statement finds customers whose last name is Albert.

This statement finds customers whose first name is Adam. Fill in your details below or click an icon to log in:. Email required Address never made public. Name required. Follow me via Email Enter your email address to follow this blog and receive notifications of new posts by email.

Join 3, other followers. Follow me on Twitter sqlstudent Blog at WordPress. Follow Following. SQL Studies Join 3, other followers. Sign me up. Already have a WordPress.



0コメント

  • 1000 / 1000