数据库设计存储方案征集..
需求是这样的,需要存储的对象的元数据信息是动态的,例如 
  "书本 "这样一个对象相关的元数据可能有: 
 A:      Name(名字)、   Number(号码)   、ISBN(序号) 
 也可能是: 
 B:      Author(作者)、Pages(页码)、Publisher(出版商) 
 那么该用什么方式存储?目前想到的法子是在数据库中设计一个表.表有两个字段 
 1、ID         2、XML 
 那么存储一个对象的例子如下 
 ID=1 
 XML=    
              <Name> Thinking   In   Java </Name>  
              <Number> 1223 </Number>  
              <ISBN> 121212-23232 </ISBN>    
 当元数据更改了(例如从A改为B了)..那么先前已经存储的对象依然有效,只需要在数据库中继续添加对象,例如 
 ID=2 
 XML= 
              <Author> Song   Liang   Yun </Author>  
              <Pages> 789 </Pages>  
              <Publisher> Spring </Publisher>    
 但是上述设计存在一个问题..例如我要查找作者为Song   Liang   Yun的对象,则需要从数据库中先提取XML字段,再一个一个的查找... 
 这样貌似不太好,大家有什么更好的方案?例如用已有的XML数据库之类????   具体有什么推荐?分数不够再加。。   
------解决方案--------------------参考SQL Server 2000中以下部分: "使用 FOR XML 检索 XML 文档 "
------解决方案--------------------如果使用SQL2005,不妨直接存为xml类型,使用XQuery等功能进行查询
------解决方案--------------------Create table BOOK(BookID int,BookName varchar(100)) 
 insert BOOK 
 select 1, 'book1 ' 
 union all 
 select 2, 'book2 ' 
 ------------------------ 
 Create table BOOKATTR(BookID int,AttrName varchar(100),AttrValue varchar(100)) 
 insert BOOKATTR 
 select 1, 'Name ', 'Thinking In Java ' 
 union all 
 select 1, 'Number ', '1223 ' 
 union all 
 select 1, 'ISBN ', '121212-23232 ' 
 union all 
 select 2, 'Author ', 'Song Liang Yun ' 
 union all 
 select 2, 'Pages ', '789 ' 
 union all 
 select 2, 'Publisher ', 'Spring '     
 select AttrName,AttrValue  
 from BOOKATTR  
 where BookID = (select BookID  
 		from BOOKATTR  
 		where AttrName =  'Author ' and AttrValue =  'Song Liang Yun ') 
 for xml auto, elements   
 --得到----------------------------------- 
  <BOOKATTR>  
 	 <AttrName> Author </AttrName>  
 	 <AttrValue> Song Liang Yun </AttrValue>  
  </BOOKATTR>  
  <BOOKATTR>  
 	 <AttrName> Pages </AttrName>  
 	 <AttrValue> 789 </AttrValue>  
  </BOOKATTR>  
  <BOOKATTR>  
 	 <AttrName> Publisher </AttrName>  
 	 <AttrValue> Spring </AttrValue>  
  </BOOKATTR>    
 --------------------------------------- 
 现在我们需要一个xstl转换成下列格式就可以了:) 
  <BOOKATTR>  
      <Author> Song Liang Yun </Author>  
      <Pages> 789 </Pages>  
      <Publisher> Spring </Publisher>  
  </BOOKATTR>