Re: NameSpace Issue.
  Home FAQ Contact Sign in
microsoft.public.sqlserver.xml only
 
Advanced search
POPULAR GROUPS

more...

microsoft.public.sqlserver.xml Profile…
 Up
Re: NameSpace Issue.         


Author: Martin Honnen
Date: Jun 6, 2007 04:52

StringFellow Hawk wrote:
> Hi, can someone show me how to get the following working with a NameSpace.

You need to declare the default element namespace, see below:

SELECT
x.item.value('@AquirerBank[1]', 'VARCHAR(5)') AS AquirerBank
,x.item.value('@AcquirerID[1]', 'int') AS AcquirerID
,x.item.value('@StoreName[1]', 'VARCHAR(50)') AS StoreName
,x.item.value('@MerchantID[1]', 'VARCHAR(50)') AS MerchantID
FROM
@Merch.nodes('
declare default element namespace
"http://www.mywebsite.com/supMerchants";
//supMerchants/Body'
) AS x(item)

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
1 Comment
Re: NameSpace Issue.         


Author: Ryan Waight
Date: Jun 6, 2007 05:25

Great, thank you.
Show full article (0.77Kb)
no comments