Êý¾ÝÒÔxml¸ñʽ·µ»Ø - MS-SQL Server / Ó¦ÓÃʵÀý
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked" isBranch="true" label="¼¼Êõ¿Æ" >
<folder state="unchecked" isBranch="false" label="ÕÅÈý" />
<folder state="unchecked" isBranch="false" label="ÀîËÄ" />
<folder state="unchecked" isBranch="false" label="ÍõÎå" />
<folder state="unchecked" isBranch="false" label="ÕÔÁù" />
......
¡¡¡¡ </folder>
¡¡¡¡ <folder state="unchecked" isBranch="true" label="Éú²ú¿Æ" >
<folder state="unchecked" isBranch="false" label="Å£Æß" />
<folder state="unchecked" isBranch="false" label="Âí°Ë" />
......
¡¡¡¡ </folder>
......
</folder>
ѧϰ Õâ¸ö¡·¡£
ÓÐÇëPÁº
select * from t_record FOR XML AUTO
µÈµ½´ð°¸
ding
if object_id('tb') is not null
drop table tb
go
create table tb(id int,name varchar(20))
insert into tb(id,name)
select 1,'zy' u
Ïà¹ØÎÊ´ð£º
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
Êý¾Ý¿â±íÖÐÓÐÒ»ÁУ¨TranXml£©ÀàÐÍÊÇxml£¬´æ´¢µÄÊÇÀàËÆ
<fathernode>
<a>aaa
</a>
<b>bbb
</b>
</fathernode>
µÄÐÅÏ¢£¬²¢ÇÒͨ¹ý²éѯ·½· ......
clientserial devseral chunnelnum devdata5
CZ0001 308001 5000 11.1
CZ0001 308001 5001 11.2
CZ0001 308001 5002 11.3
CZ0001 3080 ......
CREATE PROCEDURE [selectvipcompany]
@username varchar(50),
@companyname varchar(50),
@endtime varchar(1)
AS
declare @sql varchar(1000)
set @sql=''
if (@username<>null and @username ......
<table style="width: 1000px"><tr>
<td style="height: 38px; width: 35px;">
ÐÕÃû</td>
......