One easy way I've found to query GEDCOM data in SQLServer is to use the import / export features that come with The Master Genealogist application. The Master Genealogist lets you export data to csv. Once you have the data in csv you can then use the Data Transformation Services wizards of SQLServer to import it.
I've certainly had success exporting data from The Master Genealogist into SQLServer but have not as yet tested the GEDCOM import feature.
Otherwise, you could always checkout the GenealogyJ codebase and take a look at the GEDCOM reader there. If java is not to your liking try the perl Gedcom module instead.