Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8533173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:53:56+00:00 2026-06-11T09:53:56+00:00

With the following SQL, I am generating 2 rows and wrapping them in individual

  • 0

With the following SQL, I am generating 2 rows and wrapping them in individual soap envelopes.

declare @XmlDoc xml
;with XMLNAMESPACES 
(
    'http://schemas.xmlsoap.org/soap/envelope/' as soapenv,  
    'http://amsa.com/contract/baserequestcontract/v1.0' as H1,
    'http://MyCompany.org/contract/mrmPerson/v1.0' as N1,
    'http://MyCompany.org/contracts/person' as N2,
    'http://MyCompany.org/contracts/demogTypes' as N3

)

select @XmlDoc = 
(
  select
    top 2
    PersonID as 'soapenv:Header/H1:PersonID',
    IsAuthorizedForUse as 'soapenv:Body/N1:SaveMRMPersonRequest/N1:Person/N2:PersonTier2/N2:AddressArray/N2:Address/N3:CommonDemogInfo/N3:IsAuth'
  from
    dbo.PersonDemogAddress
  for xml 
    path ('soapenv:Envelope'),
    root ('root'),
    type,
    elements xsinil

)
select @XmlDoc

the output looks like this:

<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:N3="http://MyCompany.org/contracts/demogTypes" 
  xmlns:N2="http://MyCompany.org/contracts/person" 
  xmlns:N1="http://MyCompany.org/contract/mrmPerson/v1.0" 
  xmlns:H1="http://amsa.com/contract/baserequestcontract/v1.0" 
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">  
<soapenv:Envelope>
<soapenv:Header>
  <H1:PersonID>1</H1:PersonID>
</soapenv:Header>
<soapenv:Body>
  <N1:SaveMRMPersonRequest>
    <N1:Person>
      <N2:PersonTier2>
        <N2:AddressArray>
          <N2:Address>
            <N3:CommonDemogInfo>
              <N3:IsAuth>Y</N3:IsAuth>
            </N3:CommonDemogInfo>
          </N2:Address>
        </N2:AddressArray>
      </N2:PersonTier2>
    </N1:Person>
  </N1:SaveMRMPersonRequest>
</soapenv:Body>
</soapenv:Envelope>  
<soapenv:Envelope>
<soapenv:Header>
  <H1:PersonID>8</H1:PersonID>
</soapenv:Header>
<soapenv:Body>
  <N1:SaveMRMPersonRequest>
    <N1:Person>
      <N2:PersonTier2>
        <N2:AddressArray>
          <N2:Address>
            <N3:CommonDemogInfo>
              <N3:IsAuth>Y</N3:IsAuth>
            </N3:CommonDemogInfo>
          </N2:Address>
        </N2:AddressArray>
      </N2:PersonTier2>
    </N1:Person>
  </N1:SaveMRMPersonRequest>
</soapenv:Body>

However, for the xml column < N3:IsAuth >, I want to use the whole word < N3:IsAuthorizedForUse > so I simply changed SELECT part of above query as

select  
  top 2  
    PersonID as 'soapenv:Header/H1:PersonID',  
    IsAuthorizedForUse as 'soapenv:Body/N1:SaveMRMPersonRequest/N1:Person/N2:PersonTier2/N2:AddressArray/N2:Address/N3:CommonDemogInfo/N3:IsAuthorizedForUse

And I get this error:

Msg 103, Level 15, State 4, Line 16  
The identifier that starts with 'soapenv:Body/N1:SaveMRMPersonRequest/N1:Person/N2:PersonTier2/N2:AddressArray/N2:Address/N3:CommonDemogInfo/N3:IsAuthorizedForUse' is too long. Maximum length is 128.

Any way to solve this? The xml namespaces, element names and hierarchy cannot be changed unfortunately. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:53:58+00:00Added an answer on June 11, 2026 at 9:53 am
    SET QUOTED_IDENTIFIER OFF
    SET ANSI_NULLS ON
    

    place this at the starting it solved my problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I receive the following error in Microsoft SQL Server Report Builder Error While generating
Facing problem for generating SQL Server Query In the Following query dynamic conditions are
Hibernate is generating the SQL for the following query : select pcp.id from PersistentContentProfile
The following SQL Lite statement in Trac SELECT id, changetime / 1000000 as 'MODIFIED',
The following sql will return a count of how many users have played a
In the following SQL statement, SQLite sorts correctly but MySQL does not: However, if
I have the following SQL Server query: SELECT area FROM places WHERE REPLACE(area,'-',' ')
I have the following SQL snippet within a select statement: CASE WHEN wot.id LIKE
I have the following SQL query: SELECT r.BEZEICHNUNG AS BEZEICHNUNG, r.ID AS ID, ra.BEZEICHNUNG
I currently have the following SQL query that lists all the names of all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.