When I visit a sms 2.0 customer site, I setup several things to help me during the engagement, one of which is to prepare 3 queries in the SMS console to expose Advertisement, Package and Collection information. Here's how I do this.
Create three queries, if there is a naming standard then that affects how I name these. But for this example I will call them:
1) SMS_Collection
2) SMS_Package
3) SMS_Advertisement
I then insert the following WQL in to each of the queries:
1) Collection
select Name, CollectionID from sms_collection
2) Package
select Name, PackageID, StoredPkgVersion, PkgSourcePath from SMS_Package
3) Advertisement
select AdvertisementName, AdvertisementID, CollectionID, PackageID, ProgramName from SMS_Advertisement
You can expose a whole lot more infomation, just replace everything after the select clause and before the from clause with a * to return all the columns (select * from SMS_Package). I prefer the WQL examples above as they expose and line up only the columns I need.
If you want to know more about WQL\WMI then check out these links:
Creating and Editing Query Statements: http://www.microsoft.com/technet/prodtechnol/sms/sms2003/opsguide/ops_35pn.mspx?mfr=true
WMI Administrative Tools: http://www.microsoft.com/downloads/details.aspx?FamilyId=6430F853-1120-48DB-8CC5-F2ABDC3ED314&displaylang=en
SMS2003 Scripting Guide: http://www.microsoft.com/downloads/details.aspx?FamilyID=81300e34-09cf-4672-a5c4-06aa238275ec&DisplayLang=en
WMI Reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_reference.asp
Google: http://www.google.com/search?hl=en&lr=&c2coff=1&q=wql+sms