Not 100% sure for a 4.x vCenter Server for the filename but all installations should have all the SQL scripts in their installation folder, either directly in the folder or in an "SQL" subfolder.
c:\program files\vmware\infrastructure\virtualcenter server\ being the default one.
You should find something called VCDB_mssql.sql in there. DO NOT RUN THE WHOLE SCRIPT.
Just copy and paste out the parts that actually create the missing tables (VPX_DEVICE and VPX_STAT_COUNTER) in your case.
As always do a full backup of the functional database before you do any changes.