Query variables from older versions

I am trying to write a sql query to list all variables of a Solidworks model based on a specific version.  For instance, if the model has 20 versions I want to know what the variables were in version 5 or maybe 10.  I do not see a way to link the variables to specific versions or the file.  How is this done?

Thank you.....

SolidworksSolidworks Pdm enterprise Pdm