How to limit default xmlnamespaces?

I have the following Tsql script:
; with xmlnamespaces (
default 'http://www.tn.gov/mental/Schemas/CrisisAssessment', 'http://www.w3.org/2001/XMLSchema-instance' as xsi)
, prov as (
select NPI,FileCreationDate,
cast(FileCreationTime as time) FileCreationTime
from [August_Import_Data_Final]
group by NPI,FileCreationDate, FileCreationTime
SELECT
NPI as [NPI],
FileCreationDate as [FileCreationDate],
cast(FileCreationTime as time) FileCreationTime,
Select
ProviderPatientNo ,
Select
t_phone.ProviderPhoneAssessmentId,
t_assess.ProviderF2FAssessmentId as [F2FAssessment/ProviderF2FAssessmentId],
AssessmentDate as [F2FAssessment/AssessmentDate],
case when [DateTransportedToFacility] is null then 'true' else null end as [F2FAssessment/DateTransportedToFacility/@xsi:nil], 
[DateTransportedToFacility] as [F2FAssessment/DateTransportedToFacility/*]
FROM (select distinct ProviderPatientNo, ProviderPhoneAssessmentId,ProviderF2FAssessmentId,CallEndDate,CallEndTime,DispatchDate,DispatchTime,
CallDisposition,DispositionOther,Notes
from #phones where CallDisposition in (1,5,8) and ProviderPhoneAssessmentId = t_base.ProviderPhoneAssessmentId) t_phone
inner join #Assessments t_assess On t_phone.ProviderPatientNo = t_assess.ProviderPatientNo and t_assess.ProviderF2FAssessmentId is not null
left join #Drugs d on d.ProviderF2FAssessmentId = t_assess.ProviderF2FAssessmentId
left join #HospAlt ha on ha.ProviderF2FAssessmentId = t_assess.ProviderF2FAssessmentId
left join #HospDisp hd on hd.ProviderF2FAssessmentId = t_assess.ProviderF2FAssessmentId
FOR XML PATH('PhoneAssessment'), ELEMENTS, type) AS [*]
FROM (select distinct ProviderPhoneAssessmentId, ProviderPatientNo,LastName,FirstName,SSN,DOB,Gender,Race,Ethnicity from #base
) t_base
FOR XML PATH('Patient'), type
from prov
for xml path(''), root('Provider')
But this results in output like:
<Provider xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.tn.gov/mental/Schemas/CrisisAssessment">
<NPI>1306875695</NPI>
<FileCreationDate>2014-02-05</FileCreationDate>
<FileCreationTime>09:24:25</FileCreationTime>
<Patient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.tn.gov/mental/Schemas/CrisisAssessment">
<ProviderPatientNo>146477</ProviderPatientNo>
(Don't worry about the details in my first Tsql query; just focus on the xsi element only).  Instead of the above XML, I want it to look like:
<Provider xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.tn.gov/mental/Schemas/CrisisAssessment">
<NPI>1306875695</NPI>
<FileCreationDate>2014-02-05</FileCreationDate>
<FileCreationTime>09:24:25</FileCreationTime>
<Patient>
<ProviderPatientNo>146477</ProviderPatientNo>
So I only want this xsi attribute to appear one time at the beginning of my file.  How can I do this?  And make all of the Patient tags appear as just <Patient> instead?
Ryan D

I don't think that there is a way to do that easily.
Check
http://stackoverflow.com/questions/12823556/how-to-avoid-namespace-in-child-nodes-using-for-xml-path
http://stackoverflow.com/questions/3242070/how-do-i-remove-redundant-namespace-in-nested-query-when-using-for-xml-path
Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

Similar Messages

  • How to limit the max dialog no that one user can use at the same time?

    Hi,
    I meet one performance problem that one user can open 6 sessions in the GUI and he/she can run 6 reports at the same time witch could occupy 6 dialogs in the sap R/3 instance. It makes poor performance for other users.
    Would you pls tell me how to limit the no. of sessions one user can create at the same time or how to limit the no. of dialogs one user can occupy at the same time?
    Thanks a lot!
    I used this parameters in the default profile as blew:
    rdisp/rfc_check 1
    rdisp/rfc_use_quotas 1
    rdisp/rfc_max_own_used_wp 20 (means: 20%)
    It still didn't work.
    Sean

    Hello,
    We can reserve DIA W.P by giving value to the parameter :- rdisp/rfc_min_wait_dia_wp=1(default)
    that have to necessarily remain free for other users.
    This parameter is used to reserve a number of dialog work processes for Dailog mode.
    For eg. If 10 dialog w.p. are configured for the instance(rdsip/wp_no_dia=10) and the parameter rdisp/rfc_min_wait_dia_wp=3 is set,parallel RFC's can occupy a maximum of 7 DIA W.P.3 DAI W.P. always remain free for dialog mode.
    But now the question is how we assign/restrict this free dialog w.p. to the specific user.
    Reply...
    Regards,
    JUNAID

  • How to limit the number of items in a KPI Status list web part?

    How to limit the number of items in a KPI Status list web part? There is no paging option for Business Category Status list or any limit can be made by changing the Item limit in default view unlike other SharePoint List web parts. So How to achieve it?
    Kindly help.
    Regards,
    ZA
    zzzSharePoint

    Hi,
    According your post, I know you would like to set the item display limit in Status List web part.
    In the web part, the number of items to display is based on the view which you selected when configuring the web part. The default view for status list is status list view.
    However, I am not able to limit the items’ display number of the status list view. After changing the items limit, the list item displayed would not match the number specified by Item Limit. Thus, it is not possible to limit the number
    of items in the Status list web part.
    It could be a potential issue in SharePoint 2010.
    We will log this issue to our suggestion box. As after the submission, we may not have any time guarantee when the fix may be released, but it may come out on next cumulative update.
    Appreciate your time and efforts.
    Thanks.
    Tracy Cai
    TechNet Community Support

  • How to limit the number of items that a list control can hold?

    Hi,
    I am using a Flex3 List control for one of my projects.
    I add drag & drop functionality to it, so that i can drag & drop elements from one control to another.
    How to limit the number of items that a list control can hold / can be dropped in a list control ?
    - Sen.

    1. Listen for the dragdrop event on the control you are dragging onto.
    2. check the length of the items in the dataprovider - if it exceeds your maximum override the default drop action with e.preventDefault(); (assuming you used e for the event on the handler).
    Regards,
    Mark.

  • How to limit  dimensions values of querybuilder

    Hi,
    I want to learn how to limit dimension value in query builder. i want, the user who run the querybuilder can not see a dimension value which i do not want to display.
    For example,
    The time dimension has "2000" and "2001" values as default which is defined in database. Normally when i run the querybuilder for create new presentation or calculation, In the dimensions panel of the querybuilder display all values of each of dimension. The user can select values which she/he want from that list.
    But i want to limit values which the user can see in the dimensions panel of the querybuilder. for this time dimension example, i want to hide "2001" value from the user. How can i do it. if there is any sample code, please share.
    Thank you very much for your helps.
    ilknur

    Thanks Thomas, excellent suggestions as always.
    If anybody wants more information regarding Thomas' suggestions please refer to
    Oracle9i OLAP Developer's Guide to the OLAP DML for the AW Permit command.
    In sumamry: To create permission programs, you define two programs with the names permit_read and permit_write. In these programs, you can specify PERMIT commands that grant or restrict access to individual workspace objects. In addition, you write these programs as user-defined functions that return a Boolean value, and the return value indicates to Oracle OLAP whether or not the user has the right to attach the workspace.
    For relational security there is an excellent tutorial on the database pages of OTN, follow this link:
    http://otn.oracle.com/obe/start/index.html
    then follow the links for Oracle9i Database Release 9.2.0.2 - Security - Creating Label-based Access Control. This module describes how to use Oracle Label Security to setup security based on label policies
    These security layers should be transparent to the OLAP metadata layer, therefore, once you have implemented your chosen security method your BI Beans application will only need to connect with the appropriate user to inherit the security layer. For more information see the Security section of the BI Beans Help:
    http://otn.oracle.com/bibeans/903/help/
    BI Beans product Management Team
    Oracle Corporation

  • How to limit the number of search results returned by oracle text

    Hello All,
    I am running an oracle text search which returned the following error to my java program.
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    #### ORA-29902: Fehler bei der Ausführung von Routine ODCIIndexStart()
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    java.sql.SQLException: ORA-29902: Fehler bei der Ausführung von Routine ODCIIndexStart()
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
    When i looked up the net, one suggestion that was given is to narrow the wildcard query, which i cannot in my search page. Hence I am left with the only alternative of limiting the number of results returned by oracle text search query.
    Please let me know how to limit the number of search results returned by oracle text so that this error can be avoided.
    Thanks in advance
    krk

    Hi,
    If not set explicitly, the default value for WILDCARD_MAXTERMS is 5000. This is set as a wordlist preference. This means that if your wildcard query matches more than 5000 terms the message is returned. Exceeding that would give the user a lot to sift through.
    My suggestion: trap the error and return a meaningful message to the user indicating that the search needs to be refined. Although it is possible to increase the number of terms before hitting maxterms (increase wildcard_maxterms preference value for your wordlist), 5000 records is generally too much for a user to deal with anyway. The search is not a good one since it is not restricting rows adequately. If it happens frequently, get the query log and see the terms that are being searched that generate this message. It may be necessary to add one or more words to a stoplist if they are too generic.
    Example: The word mortgage might be a great search term for a local business directory. It might be a terrible search term for a national directory of mortgage lenders though (since 99% of them have the term in their name). In the case of the national directory, that term would be a candidate for inclusion in the stoplist.
    Also remember that full terms do not need a wildcard. Search for "car %" is not necessary and will give you the error you mentioned. A search for "car" will yield the results you need even if it is only part of a bigger sentence because everything is based on the token. You may already know all of this, but without an example query I figured I'd mention it to be sure.
    As for limiting the results - the best way to do that is to allow the user to limit the results through their query. This will ensure accurate and more meaningful results for them.
    -Ron

  • HT5100 How to limit the number of downloaded videos in parallel to one.i want my iPad itunesu to download only one video at once at time and when finished from downloading it to pass to the second queued one.

    How to limit the number of downloaded videos in parallel to one.i want my iPad itunesu to download only one video at once at time and when finished from downloading it to pass to the second queued one.

    @Tylerdowner: hmm.. maybe yes.. I just want to use the DOWNTHEMALL AddsOn for the saving file not the default download.. because my costumer download MP3 files and save it 3 or more files at a time so my Internet Connection goes down :( so I just want to limit them to save 1 file at a time.
    or if there is another way to limit it to 1.. please tell me :(

  • How to decie required how much limit rquire to MAX_DUMP_FILE_SIZE

    Hi Team,
    I am junior oracle DBA.
    Please suggest that "How to decie required how much limit rquire to MAX_DUMP_FILE_SIZE". I understood , default size of MAX_DUMP_FILE_SIZE is unlimited.
    But, I receiving mails from application team,how much require. for example 5M or 20M etc..
    Please suggest any one how to confirm limit. ORACLE VERSION IS 11.2
    Thanks,

    what is the average size of trace files you have ?
      3 MB  size of files existed in this file system.
    how many trace files are generated per day or week ?
    10-15 Files per week
    what is the free space on corresponding file system ?
      60% space used 40% is free.
    do you purge automatically these trace files and when ?
    No idea. How to check this??
    Thanks,

  • How to save default RS232 port configuration in Labview 2011

    I have an application using two serial ports. I would like to give the
    user possibility to select the serial ports from the list of his ports
    (depending on the hardware configuration) and their settings and save
    these as defaults in some ini file. Can someone give me a hint?
    Is there any possibility how to limit the Resource names selector only
    to COM ports? By default it offers everything, i.e. including GPIB and
    LPT etc.. That may be confusing for some users, I would like to make
    it easier to understand for an unexperienced user.
    Thanks
    ladislav

    By creating my VISA resource name control with a right click on the VISA Configure Serial Port vi , it only showed me the COM ports. 
    Additional filtering of displayed names can be done by right click on the control and choose I/O Name Filtering.
    To store/read values from an ini file you can use the Configuration file vis found in FILE I/O
    Quick and dirty demo
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • [help] How to limit gnome started using a specific resolution?

    TV via vga interface, the default will use the 1920 * 1080 resolution, however, when the TV will prompt "mode is not supported"! Tests found under Windows supports up to 1280 * 1024, another big mistakes!
    Ask, gnome how to limit starts to use a specific resolution?
    Thank you!

    Please remove the "[help]" from your title.  All threads in that subforum are requests for help.  The inclusion of things like that, "please help", etc are both unnecessary and somewhat irritating to many members of this community.  It is not required that yu remove it, but I would strongly recommend it.

  • How to change default compile directory tmp_ejb?

    Dear all,
    Someone knows how to change the default directory "tmp_ejb...." in WebLogic Server
    7.0?
    This is the default directory where WebLogic Server 7.0 generates and compiles
    the EJB's declared in config.xml.
    I try to specify the attribute TmpPath="ANOTHER_TMP_LOCATION_DIRECTORY_FOR_EJB"
    in the EJBContainer node but still doesn't work.
    The same thing happens when I test this attribute on EJBComponent declaration.
    Someone knows if there is an enviroment variable that specify this tmp_ejb location
    path?
    It's false that the tmp_ejb is located where the config.xml file is placed.
    I have 3 weblogic servers and they haven't the same behaviour.
    Someone can help me??????
    Thanks.

    I ran into the same problem and was wondering if you got an aswer the question you posted in BEA's news group: "How to change default compile directory tmp_ejb?
    Thanks

  • How to change default approval for ResourceAuthorizerApproval ?

    Hi,
    I'am new in OIM and I follow documentation where I found some predefined workflows. I'd like to use them.
    Could you tell me, step by step, how to change default approval for ResourceAuthorizerApproval (only for my new defined resource).
    I'm using OIM 11g and Design Console 11.1.1.3.0.2.0

    Ok, I made new tamplate (copy of existing one), there I changed Template Level Approval Process and set allowed resources. It seems to be ok :)
    If there are other solutions please share with me
    Thanks
    M.

  • How to change default Current Flag values for SCD2?

    I'd be curious to find out how to change default Current Flag values for SCD2 (instead of 0/1 to use N/Y)
    Probably I can change IKM module .... is there another way?
    Thanks

    Hi,
    You need change the IKM. This values are hardcode in the IKM.
    You can create a new IKM and the values used are a options of the IKM.
    Regards
    Edited by: Uthred on May 18, 2009 4:27 PM

  • How to change default save as location

    hi,
    how to change default save as location in acrobat 7.0?

    Why is Acrobat involved in this process at all? Why don't you save directly the pdf from your email program directly where you want it to be? Acrobat is just adding another step to this process.

  • How to change default Ovi Player store ...

    Hi, 
    I need help from you people.  
    I had installed Ovi Player. Whenever I try to open Ovi Player, the default store gets’ open is "India". I change the store location to "Germany". When I do the search for particular music, it will again take me to "India" store instead of "Germany" store. In addition, most annoying is that I have to re-login but my user id and password will not work as its different store. Also when I go via music.nokia.de and try to login, it open Ovi player and since default location is "India", it takes me to India store and my login credentials do not work.  
    I ask Nokia care on how to change default Ovi Player Store location but they are unable to provide any good answer.  
    I already un-install / re-installed but won't work. Do any of you have answer to my problem? I want my default Ovi Player location to be "Germany" instead of "India".  
    More information, my regional settings have location as “Germany” and language as “English”.  
    Please help. 
    Thanks for your response.
    Regards,
    Subhendra
    Nokia N97 Black
    RM-505
    V12.0.026
    0586701
    Solved!
    Go to Solution.

    I had got message from Nokia on how to correct this issue. This had solved the problem. Below is the mail from them ...
    Dear Chakraborty,
     Thank you for your response.
     This error is sometimes caused by a corrupted MDataStore.db3 file used by the Ovi Player.  This file will need to be deleted with the Ovi Player closed.  Then open the player and the datastore file will be rewritten by the application:
     Close Ovi Music Player and delete the MDataStore.db3 file:
     Vista C:\Users\<user>\AppData\Local\Nokia\Nokia Data Store\DataBase\MDataStore.db3
     XP C:\Documents and Settings\<user>\Local Settings\Application Data\Nokia\Nokia Data Store\DataBase\MDataStore.db3
     Both of these locations are in hidden folders.  So, to view them users will need to: 
     Open Windows Explorer > Tools > Folder Options > View > Show Hidden Files and Folders
    Once Ovi Music is opened again the MDataStore.db3 file will be rewritten to this folder.
      After that manipulation try to install the Ovi Player once again:
     http://europe.nokia.com/explore-services/music/nokia-music
      Best regards
     Nokia Care Team

Maybe you are looking for

  • Indesign cs4: why are some documents extremely slow?

    i am working on a iMac (2.8ghz core i5, 8gb memory). Some documents are incredibly slow on my iMac - on others in the same office the documents are working fine. Even if I set the preview of images to 'low' after every action - selecting a tool, sele

  • Usage of 'Select for all entries' for dynamic internal tables..

    Hi all, I have a situation where I need to use select for all entries for a dynamic internal table. select * from /BIC/AZHSD_O1500 into i_table for all entries in <b>Dynamic_table</b> where doc_number = <dynamic_table????????> here iam not knowing ho

  • Outbound Interface for exemption letter extraction – AR

    Hello everyone... i need some information regarding outbound interface for exemption letter extraction in AR Pls help me regarding this... Thank you

  • CSS tranisition effects

    Hello there, I want to design my Responsive Parallax Website.. Like this one http://themify.me/demo/themes/parallax/#animated-bars But i want to design my own. I found a tutorial here : https://ihatetomatoes.net/make-parallax-website-respo I want to

  • Remove the duplicate value

    hi, i want to print distinct value example data is given below : Jv.No hl.no col1 col2 col3 col4 col5 1 a12 xx yy zz 11 21 b23 xx yy zz 11 21 actuallly i m not printig the hl.no in his report , for u r reference i will show to u col1 to col 5 values