suppressing namespace declarations in subqueries when using for xml

Posted on 2010-09-23
Last Modified: 2012-08-13
I 've created a sqlserver stored procedure to generate an xml file.  I use " with xmlnamespaces"  and have multiple nested "select for xml " statements.   When the xml file is created, the namespace shows up for each nested query.  What can I do in the stored procedure to eliminate the namespace in the subquery elements?

Thank you,

Question by:SAZ2
  • 3
  • 2

Expert Comment

Comment Utility
After getting the namespace nodes, you could remove the namespace from the xml
Exectue the stored procedure
see this link,
it has everthing about namespace

Author Comment

Comment Utility
Thank you for the response.  Will you please post the link?  Thanks

Accepted Solution

rajaamirapu earned 500 total points
Comment Utility

Author Comment

Comment Utility
Thank you all for the response.  I have gotten it to with the namespaces.  Thank you

Author Closing Comment

Comment Utility
Not sure how to grade.  The program worked with all the imbedded namespaces, I thought it would not so I was trying to get rid of them.   I appreciate the feedback none the less.

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now