Need help with my Xml join

  • Hi I was wondering if anyone can help me with my join. I am trying to select back a list of certification but when I try to test it out, it is show me a empty row. I am not sure if I am parsing it correctly

    If @CertificationList is Not Null

    set @SqlString = @SqlString + '

    Inner Join User_Certification

    ON User_Certification.UserId = [User].UserId

    Inner Join Certification

    ON User_Certification.CertificationId = Certification.CertificationId

    INNER JOIN @CertificationList.nodes(''/CertificationList/Certification/CertificationName'') as xmlCertificationList(CertificationName)

    ON xmlCertificationList.CertificationName.value(''.'',''VARCHAR(20)'') = Certification.CertificationName '

  • Since you showed us only part of your query without showing the XML, I don’t think that anyone will be able to tell you if you made a mistake in your Xquery expression. I suggest that you’ll take a look at the link in my signature and then post the question again in a way that it will be much easier to understand your problem and help you. Also I noticed that in the part of the value method you specify dot in the path part. This will take all the text nodes and concatenate it together. Could be that this is your problem (but since I didn’t see your XML I can’t know for sure).

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply