Get PropertyNames and Values

This was originally written for CS 1.1, but should work with any table that has the PropertyNames and PropertyValues in the column list.  Such as aspnet_Profile, cs_UserProfile, as well as cs_Posts, cs_Threads, and cs_Sections.

This can be useful in doing full searches on this text.  But it's very costly on the database because you'll have to create a CURSOR to loop through all of your records, select the PropertyNames and PropertyValues from each record, and pass it to this function (or select straight from the FUNCTION in your queries.

Notes from the author (ScottW):

CS uses ExtendedAttributes to allow metadata about a post, user, or section to be stored
in a special ':' delimited format. This enables storing metadata without adding new columns
to any tables, changing sprocs, etc.

However, any data stored in this format is not easily queryable (so use it wisely Smile

Occassionaly, you may want to query against this data. This function should make that task simple!

Keys are stored in this format: string:S:Int:Int = Key + :S : Starting Location : Length :

An example: 'Theme:S:0:7Big SmileummyTotalPosts:S:7:1:BannedUntil:S:8:21:UserBanReason:S:29:5:'

Values are stored in a single string with no spaces between them.
An example: 'default04/20/2005 12:16:41 AMOther'

Theme starts a 0 and continues for 7 characters (default)
dummyTotalPosts starts at 7 and coninutes for 1 character (0)
BannedUntil starts at 8 and continues for 21 characters (4/20/2005 12:16:41 AM)

Comments
  • re: Get PropertyNames and Values

    nise ... thank you
  • re: Get PropertyNames and Values

    Thanks
  • re: Get PropertyNames and Values

    god thanks ....
  • re: Get PropertyNames and Values

    very nice Thanks
  • re: Get PropertyNames and Values

    good
  • re: Get PropertyNames and Values

    nice post
  • re: Get PropertyNames and Values

    amazing
  • re: Get PropertyNames and Values

    thaaanks ya ..
  • re: Get PropertyNames and Values

    This helped me today. Thanks, Eric!
  • re: Get PropertyNames and Values

    Really helpful , Thanks
  • re: Get PropertyNames and Values

    العاب @ طيور الجنة
  • re: Get PropertyNames and Values

    منتديات @ العاب بنات
  • re: Get PropertyNames and Values

    العاب @ طيور الجنة
  • re: Get PropertyNames and Values

    thanx alot Really helpful ...
  • re: Get PropertyNames and Values

    thaaaaaaaanx