mssqlÖÐÓÃxmlµÄ·½·¨²ð·ÖÒÔ²»¶¨¿Õ¸ñΪ·Ö¸î·ûºÅµÄ×Ö·û´®
---xml²ð·ÖÒÔ²»¶¨¿Õ¸ñΪ·Ö¸î·ûºÅµÄ×Ö·û´®
--²âÊÔÊý¾Ý
if object_id('[tb]') is not null drop table [tb]
create table [tb]([a] varchar(200))
go
insert [tb]
select 'aaaa bbbb cccc dddd'
insert [tb]
select 'eeeeee ffff hhhh yyyy '
--¿ªÊ¼²éѯ
select
rtrim(A.A) as a,B.A2
from (
select a,convert(xml,'<root><row>'+replace(replace(rtrim(ltrim(a)),' ','</row><row>'),'<row></row>','')+'</row></root>') AS A1
from [tb]
) a outer apply (select a2=T.C.value('.','nvarchar(100)') from a.a1.nodes('/root/row')T(C)) B
/*
a A2
-------------------------------------------------------------------------- --------------------
aaaa bbbb cccc dddd aaaa
aaaa bbbb cccc dddd &nb
Ïà¹ØÎĵµ£º
¡¡ ¿ÉÒÔ½«XMLÎļþµÄÊ÷(Ö»ÓÐÒ»¸ö¶¥²ã½Úµã).ÓÚÊÇÀíËùµ±È»µÄ¿ÉÒÔÓÃÊ÷×÷ΪXMLµÄÒ»ÖÖ´æ´¢½á¹¹.
ÎÒ½«ÔÚÕâÀïÓÃC++ʵÏÖ¶Ô¼òµ¥µÄXMLÎļþµÄ½âÎö.
1.Ñ¡Ôñ´æ´¢½á¹¹:
Ê÷ÐÍÊý¾Ý½á¹¹ÓжàÖÖ´æ´¢·½Ê½,ÎÒ½«ÓÃ"º¢×ÓÐֵܱíʾ·¨",¶¨ÒåÈçÏÂ:
typedef struct CSNode
{
int subNodes;
string data;
string name;
struct CSNode *fi ......
ÔÚ
SQLServer2005
ÖжÔ
XML
µÄ´¦Àí¹¦ÄÜÏÔÈ»ÔöÇ¿Á˺ܶ࣬ÌṩÁË
query(),value(),exist(),modify(),nodes()
µÈº¯Êý¡£
¹ØÓÚ
xml
£¬ÄÑÒÔÀí½âµÄ²»ÊÇ
SQLServer
ÌṩµÄº¯Êý£¬¶øÊǶÔ
xml
±¾ÉíµÄÀí½â£¬¿´Ëƺܼòµ¥µÄÎļþ¸ñʽ£¬´¦ÀíÆðÀ´È´ÊǷdz£À§Äѵġ£±¾ÎÄÖ»Êdzõ̽һ϶øÒÑ¡£
Ïê¼û
SQLServer
Áª»ú°ïÖú£º
Ö÷Ìâ
˵ ......
»ù±¾ÔÀí
FreeTDSΪLinuxϵͳÌṩÁËTDSÐÒéµÄ¿ªÔ´¿Í»§¶Ë¡£ÓÉÓÚMS SQLºÍSybaseʹÓõÄÇ¡ÊÇTDSÐÒ飬ËùÒÔÔÚLinuxÖпÉÒÔÓÃFreeTDSÁ¬½ÓMS SQL¡£
ÎÒÃÇ¿ÉÒÔÀûÓÃOpenOffice.Org Base¼°Linux ODBCʵÏÖ¿ÉÊÓ»¯µÄÊý¾Ý¿â²é¿´·½Ê½¡£·½±ã¸öÈËÓû§Ê¹ÓÃLinuxÔ¶³Ì¹ÜÀí×Ô¼ºµÄÊý¾Ý¿âϵͳ¡£
ÃüÁîÐз½Ê½Ê¹Ó÷½·¨¼ò½é
°²×°FreeTDSºÍsqsh
Ê×ÏÈ° ......
²»ÐèÒªÉú³Édtd,ÎÞÓÃÅäÖÃ,²»ÐèÒªÉú³É¸¨ÖúÀ࣬Ëٶȿ졣Õâ¾ÍÊÇxstream+xpp³¬Ç¿»Æ½ð×éºÏ¡£
xstream´ó¼Ò¶¼ÖªµÀÀ²£¬XML Pull ParserÊÇÒ»ÖÖ¸ßËÙµÄ ½âÎöxmlÎļþµÄ·½Ê½£¬ËÙ¶ÈÒª±È´«Í³·½Ê½¿ìºÜ¶à£¨·¢ÏÖpullʽ½âÎöÏÖÔڱȽÏÁ÷ÐÐÁË£©¡£ÏÂÃæÎÒ¸ø³ö¶àÖÖʹÓ÷½·¨µÄÀý×Ó¡£
1.×î¼òµ¥µÄʹÓ÷½·¨
ÒòΪÕâ¸öÌ«¼òµ¥£¬ËùÒÔÎÒ´ÓmoogleµÄblog http: ......