I had a few problems with a database recently where the indexes of some of the tables just disappeared and stopped the application working as it should. I rebuild the indexes and all was OK for a couple of days until the same happened again. I’ve since rebuild the database and all is OK. It got me thinking about indexes/primary keys – is there a method by which I could store details of the indexes/primaries required and use some code to apply them to tables within a database, rather than having to add them back manually.
Any thoughts?
John