July 26, 2022 at 10:34 pm
Hello,
I'm looking for a proper query to find the created indexes in the last few days. I use the below query but it does not appear to be perfect. Can anyone please share the proper query to use?
select top 30 *
from <dbname>.sys.indexes i
inner join <dbname>.sys.objects o
on i.object_id = o.object_id
where o.type not in ('S', 'IT')
and modify_date >= dateadd(day, -1, getdate())
order by modify_date desc
Thanks.
July 27, 2022 at 12:54 am
There is no query that will tell you what index(es) were created in the last few days. SQL Server itself does not store that info anywhere.
SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.
August 1, 2022 at 4:25 pm
You might check the schema change history report (data from default trace).
On the database, right click, choose Reports > Standard Reports > Schema Changes History from context menu.
August 1, 2022 at 4:53 pm
You might check the schema change history report (data from default trace).
On the database, right click, choose Reports > Standard Reports > Schema Changes History from context menu.
Good tip. And this page shows how to query the default trace results using T-SQL.
If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.
August 1, 2022 at 6:33 pm
If your system is like mine, the data in the default trace lasts about 6 seconds. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
August 1, 2022 at 8:58 pm
This series of articles shows a number of ways to track schema changes. Looking in the log or the log backups might help you if nothing is setup. Extended Events or DDL triggers will probably be better if you need to track changes in the future:
August 5, 2022 at 6:04 am
This reply has been reported for inappropriate content.
There are numerous pieces of Silver Jewellery for the Woman of Today present with unique designs. But in today’s time, people consider buying Customized Jewellery. In this, customers have the freedom to choose the patterns, materials and designs. These silver jewellery defines a person’s taste and gives them an aesthetic look.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply