Friday, February 24, 2012

Is there any examples of inserting/create a namespace in sql

Is there any examples of inserting/create a namespace in t-sql...so my
stored procedure return a <root xmlns="http://ns"></root>
thanks a billion!!!Hello mm,
m> Is there any examples of inserting/create a namespace in t-sql...so
m> my stored procedure return a <root xmlns="http://ns"></root>
In SQL Server 2005, you can use the new "with xmlnamespaces" option to do
that. In SQL Server 2000, no such luck, there's not a good way (at least
that I can recall) to get namespaced XML from for xml query.
with xmlnamespaces(default 'http://ns')
select 'a' as 'text()'
for xml path('v'),root('root'),type
See the topic "Adding Namespaces Using WITH XMLNAMESPACES " in BOL for more
information
Thanks!
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||thanks for answer...now i can move on :)
"Kent Tegels" <ktegels@.develop.com> wrote in message
news:b87ad74176758c83649594b73f0@.news.microsoft.com...
> Hello mm,
> m> Is there any examples of inserting/create a namespace in t-sql...so
> m> my stored procedure return a <root xmlns="http://ns"></root>
> In SQL Server 2005, you can use the new "with xmlnamespaces" option to do
> that. In SQL Server 2000, no such luck, there's not a good way (at least
> that I can recall) to get namespaced XML from for xml query.
> with xmlnamespaces(default 'http://ns')
> select 'a' as 'text()'
> for xml path('v'),root('root'),type
> See the topic "Adding Namespaces Using WITH XMLNAMESPACES " in BOL for
> more information
> Thanks!
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>

No comments:

Post a Comment