Reply to Message

View discussion in a popup

Replying to:
tcu
Contributor
Contributor

So thanks for the replies, I do appreciate both of them!

The reason I didn't want to purge the whole Events db is because I wanted to keep the data that was relevant.  As I said in the original post, somehow the dates got messed up, so I had 14 records at the top that were in the future.  That makes it difficult to use the Event DB as a diagnostic tool when this random data keeps showing up at the top.

No matter, I am going to go ahead and post what I used from the previous thread (provided by Uday - Thanks again!)

http://communities.vmware.com/message/1881999

NOTE:  My DB is named View_Event, and my prefix is vdi

Using the TOP element from the previous thread, I ran this statement to make sure I was getting just the suspect records (I actually counted the number of records looking at the Events console in View Admin as a reference before choosing a number to use in the below SELECT Statement):

SELECT TOP (20) [EventID],[Time] FROM [View_Event].[dbo].[vdievent]

This will return the TOP 20 records that (should, read the whole thread referenced above for cautionary info) are listed in the Events console.  I knew there were less than 20 records displayed, so I looked at the results, ensured that the number of TOP (14) records I suspected was actually accurate, and then adjusted my next DELETE Statement appropriately:

DELETE TOP (14) FROM [view_Event].[dbo].[vdievent]

Walah!  So cool!

Now, I am NOT a SQL guru, and I know enough transact to get myself in a LOT of trouble, but this one wasn't a biggy.

Thanks again for everyone's help, and hopefully this helps someone else!

smooter

Reply
0 Kudos