I am Dale Hayter, a Microsoft and VMware certified Technical Consultant.

My blog has been built up over the years from my experience of working on an IT helpdesk and also from being out on-site.

Truncate VPX_HIST_STAT tables in VMware ESXi 5

If someone has installed VirtualCenter in a SQL Express database you might find that the database size limit gets hit. In this case you might want to truncate and get rid of the VPX_HIST_STAT1 tables as they take up a lot of space.

In my case below there were lots and lots of VPX_HIST_STAT1 tables


To type the command for each would be painful. Thankfully you can script the enumeration of the command you need to truncate them all. To do this paste the Command below into a new SQL Query.

select 'truncate table ' + name + ';' from SYSOBJECTS 
where name like '%VPX_HIST_STAT1%'
and xtype = 'U'
order by 1

Your then get a list of results which you can then copy and paste to a new query to finally truncate them.