日期:2014-05-17 浏览次数:20669 次
DECLARE @myDoc XML
DECLARE @imyDoc INT
SET @myDoc = '<IpList>
<StartIP>1.1.1.1</StartIP>
<EndIP>2.2.2.2</EndIP>
</IpList>'
EXECUTE SP_XML_PREPAREDOCUMENT @imyDoc OUTPUT, @myDoc
Create table #XMLa
(
StartIP varchar(100),
EndIP varchar(500)
)
INSERT INTO #XMLa SELECT *
FROM OPENXML (@imyDoc, '@myDoc', 1)
WITH(StartIP char(100) 'StartIP',EndIP varchar(100) 'EndIP')
EXECUTE SP_XML_REMOVEDOCUMENT @imyDoc
go
select * from #XMLa
drop table #XMLa
<EthernetLink>
<HubSpoke>H</HubSpoke>
<IsCustomerWANIP>N</IsCustomerWANIP>
<LAN_IP NormalRADCE=\"I\" />
<RAD_CE_IP Type=\"Yes\" NormalRADCE=\"R\" />
<MegapopIPAddress>
<InternetProtocol>IPv4</InternetProtocol>
<WanIP>Yes</WanIP>
<NetworkInformation>Static IP</NetworkInformation>
<IpList>
<IP StartIP=\"1.1.1.1\" EndIP=\"2.2.2.2\" />
</IpList>
<WanIpProviderEndIP>3.3.3.3</WanIpProviderEndIP>
<WanIpCustomerEndIP>4.4.4.4</WanIpCustomerEndIP>
<IsIsp>false</IsIsp>
<Bgp>false</Bgp>
</MegapopIPAddress>
</EthernetLink>"
declare @myDoc xml
set @myDoc = '<EthernetLink>
<HubSpoke>H</HubSpoke>
<IsCustomerWANIP>N</IsCustomerWANIP>
<LAN_IP NormalRADCE="I\"></LAN_IP>
<RAD_CE_IP Type="Yes\" NormalRADCE="R\"></RAD_CE_IP>
<MegapopIPAddress>
<InternetProtocol>IPv4</InternetProtocol>
<WanIP>Yes</WanIP>
<Netwo