SQL Server SQL for xml auto Ìí¼Ó¸ù½Úµã
½ñÌì´ÓÊý¾Ý¿âÖвéѯ³öxml£¬Í¬Ê±Ìí¼ÓÒ»¸ö¸ù½Úµã
×öÁËÈçϲâÊÔ£º
create table TestXmlQuery(
ID int identity(1,1) not null,
Name varchar(10)
)
go
insert into [TestXmlQuery] (Name) values('²âÊÔ1')
insert into [TestXmlQuery] (Name) values('²âÊÔ2')
insert into [TestXmlQuery] (Name) values('²âÊÔ3')
insert into [TestXmlQuery] (Name) values('²âÊÔ4')
select t.ID as myID,t.Name as myName from [TestXmlQuery] as t for xml auto,type
µÃµ½ÈçϽá¹û£º
<t myID="1" myName="²âÊÔ1" />
<t myID="2" myName="²âÊÔ2" />
<t myID="3" myName="²âÊÔ3" />
<t myID="4" myName="²âÊÔ4" />
select t.ID as myID,t.Name as myName from [TestXmlQuery] as t for xml auto,elements
µÃµ½ÈçϽá¹û£º
<t>
<myID>1</myID>
<myName>²âÊÔ1</myName>
</t>
<t>
<myID>2</myID>
<myName>²âÊÔ2</myName>
</t>
<t>
<myID>3</myID>
<myName>²âÊÔ3</myName>
</t>
<t>
<myID>4</myID>
<myName>²âÊÔ4</myName>
</t>
select t.ID as myID,t.Name as myName from [TestXmlQuery] as t for xml raw
µÃµ½ÈçϽá¹û£º
<row myID="1" myName="²âÊÔ1" />
<row myID="2" myName="²âÊÔ2" />
<row myID="3" myName="²âÊÔ3" />
<row myID="4" myName="²âÊÔ4" />
select t.ID as myID,t.Name as myName from [TestXmlQuery] as t for xml raw,elements
µÃµ½ÈçϽá¹û£º
<row>
<myID>1</myID>
<myName>²âÊÔ1</myName>
</row>
<row>
<myID>2</myID>
<myName>²âÊÔ2</myName>
</row>
<row>
<myID>3</myID>
<myName>²âÊÔ3</myName>
</row>
<row>
<myID>4</myID>
<myName>²âÊÔ4</myName>
</row>
select t.ID as myID,t.Name as myName from [TestXmlQuery] as t for xml raw,elements,
Ïà¹ØÎĵµ£º
Ñо¿E4XÓëFlexµÄ¹Øϵ£¬ËùÒÔ´òËã×ܽáһϣ¬ÓÐ˵µÄ²»¶ÔµÄµØ·½£¬»¹Çë´ó¼Ò¶à¶àÔÁ¡£
Ò»¡¢×î¼òµ¥Ä£Ê½£ºFlexͨ¹ýhttpserviceºÍdataProvider½øÐÐÊý¾Ý´«Êä
Xml¸ñʽÈçÏ£º
<?xml version="1.0" encoding="utf-8" ?>
<Result>
<NodeA>value1</NodeA>
<NodeB>valve2</NodeB>
…&he ......
×°FrameWorkǰûÓÐ×°¹ýIIS£¬ºóÀ´Òª·¢²¼£¬×°ÉÏIISÒÔºó³öÏÖÎÊÌâ¡£ÎÊÌâÈçÏÂͼ£º
ÔÚÍøÉÏÕÒµ½ÁËһЩ½â¾ö°ì·¨
½â¾ö°ì·¨Ò»£º
´ò¿ªvs.netÃüÁîÌáʾÐУ¬
ÊäÈëaspnet_regiis -ir -enable
½â¾öµôÁË£¬¾ßÌåµÄ²ÎÊýµÄÒâ˼ÇëÊäÈëaspnet_regiis help²éѯ
½â¾ö°ì·¨¶þ£ºÔËÐÐvs2005ÃüÁîÐУ¨¿ªÊ¼¡¢ËùÓгÌÐò¡¢vs2005¡¢tools£¬Ð´µÃ²»×¼È·£©£ ......
±éÀúXMLÎĵµ
¶ÔÓÚÏÂÃæµÄÒ»¶ÎXML´úÂ룺
XMLÎĵµÊµÀýbooks.xml£¬ÈçÏÂËùʾ£º
<?xml version="1.0" encoding="gb2312" ?>
<books>
<book status="ÒÑÊÛÍê">
<author>ÆÆÆÆ</author>
<title>XMLÈëÃÅ</title >
</book>
<book statu ......
½ñÈÕ²úÆ·²¿Òªµ¼ÅúÊý¾Ý£¬µ«ÊÇÐèÒªÁ¬½Ó²éѯ²éѯµÄ¼¸¸ö±í²»ÔÚͬһ·þÎñÆ÷ÉÏ¡£ËùÒÔÎÒ¿ªÊ¼ÊÇÕâô¸ÉµÄ£º
1.²éѯһ̨·þÎñÆ÷µÄÊý¾Ý£¬²¢µ¼Èë±¾µØExcel
2.²éѯÁíһ̨·þÎñÆ÷µÄÊý¾Ý£¬²¢µ¼Èë±¾µØExcel
3.Excleµ¼ÈëÊý¾Ý¿â£¬Êý¾Ý¿â×Ô´øÁËExcelµ¼ÈëÊý¾Ý¿âµÄ¹¦ÄÜ
4.Á¬½Ó²éѯ£¬OVER£¡
ºóÀ´²ÅÖªµÀ²úÆ·²¿ÒªÈ«¹ú50¶à¸ö³ÇÊеÄÊý¾Ý£¬ËùÒÔÿ¸ö³Ç ......
/*********************************************************/
Ŀ¼Çåµ¥CONTEXT LIST
/*********************************************************/
1.Êý¾Ý¿âDataBase
1.1Êý¾Ý¿â½¨Á¢/ɾ³ýcreate/drop database
1.2Êý¾Ý¿â±¸·ÝÓë»Ö¸´backup/restore database
/***************************************************** ......