Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

varchar(max)ºÍxmlÀàÐ͵Ä×Ö¶ÎÓÐÊ²Ã´Çø±ð£¿

¶¼ÊÇ´æxml×Ö·û´®µÄʱºò£¬xmlÀàÐÍÏà¶Ôvarchar(max)ÓÐʲôÓŵ㣿

declare @d varchar(max)
set @d=(select top 10 * from sample_table for xml auto)
print @d

ºÍ

declare @d xml
set @d=(select top 10 * from sample_table for xml auto)
print @d

xmlÀàÐÍÏÔʾ³É×Ö·û´®ºÃÏñÒªÏÔʽת»»£¬ÏÂÃæµÄÓï¾ä»á±¨´í¡£
²é²éÁª»ú´ÔÊé

²»¶®xml

ÒýÓÃ
²»¶®xml
.

SQL Server 2005 µÄÊý¾ÝÀàÐÍÓëSQL 2000 ÓÐһЩ²»Í¬£¬ÔÚ´´½¨±íʱ£¬ÁеÄÊý¾ÝÀàÐÍÐèҪעÒ⼸µã ? ÓÃvarchar(max)´úÌætext¡£varchar µÄ×î´ó³¤¶ÈΪ8000£¬µ«ÊÇvarc har(max)Ôò¿ÉÒÔ´æ´¢¶à´ï2G µÄÊý¾Ý£¬Òò´ËÆä×÷ÓÃÏ൱ÓÚSQL 2000 ÖеÄtext¡£µ«ÊÇ΢Èí¿ÉÄÜ»áºóÐøµÄSQL Server °æ±¾ÖÐÒÆ³ýtext ÀàÐÍ£¬´ÓÏÖÔÚ¾ÍÓ¦¸ÃÓÃvarchar(max) À´´úÌætext¡£ ? ÓÃnvarchar(max)´úÌæntext£¬ÓÃbinary(max)´úÌæimage. ? ΪXML Êý¾ÝÑ¡Ôñxml ÀàÐÍ¡£ÔÚSQL Server 2005 ÖУ¬ÎªXML Êý¾ÝÌí¼ÓÁËÏàÓ¦µÄÊý¾ÝÀàÐÍ£¬Òò´Ë´æ´¢XML Êý¾ÝµÄÁв»ÐèÒªÓÃvarchar(max) »ònvarchar(max)£¬¶øÓ¦µ±ÓÃxml Êý¾ÝÀàÐÍ£¬ÒÔÀûÓÃT-SQL ÖÐרÃÅÕë¶Ôxml Êý¾ÝÁеÄÐÂÃüÁÒÔ¼°Õë¶Ôxml ÁеÄË÷Òý¡£

.

ѧϰ£¬Â·¹ý£¬°ï¶¥£¡

¿ÉÒÔ°¡£¬Ã»Ê²Ã´ÎÊÌâ¡£
SQL code:

USE Northwind;
DECLARE @x XML
SET @x = ( SELECT TOP(10)* from Orders FOR XML AUTO, TYPE )
SELECT @x


------------------------------------------------------------------------------------------------------


Ïà¹ØÎÊ´ð£º

vbÓëxmlÎÊÌâ

vbÖÐÔõôͨ¹ýxmlÀ´½âÎöÊý¾Ý¿âÖеÄ×Ö¶ÎÖµ¡£
û°ì·¨ÓÃXML½âÎöÊý¾Ý¿âµÄ×Ö¶ÎÖµ£¬³ý·ÇÊý¾Ý¿âÖб£´æµÄÊÇXML¸ñʽµÄ×Ö·û´®Îĵµ¡£

XMLÓÃÀ´Õ¹Ê¾²ã´ÎµÄÊý¾Ý¡£
Êý¾Ý¿âÒ»°ãÊǶþάÊý¾Ý¡£

Êý¾Ý¿âÖб£´æµÄÊÇXML×Ö·û´®¸ñʽ£ ......

×Ö¶ÎֵΪ¿ÕµÄXMLÎļþÈçºÎµ¼ÈëDATAWINDOW

ÓÐÕâÑùÒ»¶ÎÓÉ.netÉú³ÉµÄxml(ÓÉdatasetת»¯¶øÀ´):

<NewDataSet> <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata=& ......

XML Schema ÎÊÌâ

ÇóÖú¸÷λ´óϺ£¬Ñ§Éú³É¼¨µ¥XML SchemaµÄÉè¼Æ,XMLÎĵµµÄÉè¼Æ£¬°üº¬µÄÖ÷ÒªÐÅÏ¢£ºÑ§ºÅ¡¢Ñ§ÉúÐÕÃû¡¢Ïµ²¿¡¢°à¼¶¡¢¿¼ÊÔÈÕÆÚ¡¢ÈονÌʦ¡¢Ñ§·Ö¡¢Ñ§Ê±¡¢ÐÞϰÀà±ð¡¢Java³ÌÐòÉè¼Æ³É¼¨,ÍøÂç»ù´¡ÖªÊ¶³É¼¨¡¢ÍøÒ³ÖÆ×÷³É¼¨¡¢Èí¼þ¹¤³Ì³ ......

Gridview°ó¶¨xml×ÓÁÐ

<content>
<article   imageUrl= "圖ƬµØÖ· "   Large= "圖Ƭ鏈½ÓµØÖ· ">
    <head> 標題 </head> ......

»ùÓÚXML¼¼ÊõµÄÍøÒ³ÄÚÈÝÌáÈ¡


ÈçÌâ
ÇëÎÊÄܲ»ÄܸøµãÖ¸µã£¬¹ØÓÚÕâ¸ö¿ÎÌâÎÒ²»ÖªµÀ¸ÃÔõô׼±¸£¡
˵µÃÌ«¼ò½àÁË£¬²»Àí½â

Âò¼¸±¾xml»ù´¡µÄÊé¿´¿´

ÊǽâÎöxmlÂð£¿Èç¹ûÊÇ£¬½¨ÒéÏÈÓÃdom½âÎö£¬ÕÒµ½·½·¨ºó£¬¿ÉÒÔÖ±½ÓʹÓÃjquery½âÎö£¬½¨ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ