Forum Replies Created

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

  • RE: MDX current day in set query help

    i think i got it

    select

    [Measures].[WRITTENPREMIUM] on columns,

    non empty

    [DIMGEOGRAPHY].[Hierarchy].[STATE]

    on rows

    from [EDW DWH]

    where (

    {null:[POLICYEFFECTIVEDATE].[CALENDARDATE].&[2010-05-10T00:00:00]},

    {[POLICYEXPIRATIONDATE].[CALENDARDATE].&[2010-05-10T00:00:00]:null}

    )

  • RE: Nested XML query

    not really sure i understand what you are asking....

    This?

    Select @myDoc.query('/Root/ProductDescription/Features/Maintenance/*')

  • RE: filtering result set using xquery

    just looked again there is no need for the parent axis

    select

    @xmlalliedxml.query(

    'declare namespace r = "http://dtd-sirvahub.sirva.com/xml/SCHEMA/ATS";

    data(/r:dataExtract/r:shipment/r:location[@lctnSeqNbr=sql:variable("@vcSegmentNo")]/r:lctnServiceProvider[./r:userServiceCde="OASV"]/r:svcProvNbr)')

  • RE: filtering result set using xquery

    is this what you are looking for?

    @xmlalliedxml.query(

    'declare namespace r = "http://dtd-sirvahub.sirva.com/xml/SCHEMA/ATS";

    data(/r:dataExtract/r:shipment/r:location[@lctnSeqNbr=sql:variable("@vcSegmentNo")]/r:lctnServiceProvider/r:svcProvNbr[parent::*/r:userServiceCde="OASV"])')

    same thing just short hand version of the parent axis

    @xmlalliedxml.query(

    'declare namespace r = "http://dtd-sirvahub.sirva.com/xml/SCHEMA/ATS";

    data(/r:dataExtract/r:shipment/r:location[@lctnSeqNbr=sql:variable("@vcSegmentNo")]/r:lctnServiceProvider/r:svcProvNbr[../r:userServiceCde="OASV"])')

  • RE: How to get value from root level attribute?

    not sure exactly what you are looking for, but here is one possible answer

    declare @xml as xml = '<MyXmlData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MyXml.xsd" RequestId="D9E4EBA6-5E29-4206-929C-33594AA7F713" PrintDestination="CH3001" PrintPriority="5">

    <SalesChannel>A03</SalesChannel>

    </MyXmlData>'

    select @xml.query('let $s := .

    return data($s/MyXmlData/@PrintDestination)')

  • RE: Unnecessary CONVERTs?

    how about:

    SELECTkdetail.value('@name','varchar(20)'),

    vdetail.value('@name','varchar(20)'),

    vdetail.value('@value','int')

    FROM (SELECT @XMLDATA.query('/registry/k/k') as k1) as k

    cross apply k.k1.nodes('k') as kd(kdetail)

    cross apply kd.kdetail.nodes('v') as v (vdetail)

  • RE: Retrieving a parent attribute value based on its child

    how about this?

    SELECT @myXML.query('data(//item[@id=4]/../@name)') as itemname

  • RE: Constraint help

    dropped and added both of them, both are still not trusted, I even queried to check for violations and didn't find any, but they still show as not trusted. ...

  • RE: Available rooms for a time slot during a date range query...with day of week filter

    Just thinking out loud. havent really taken this all the way to see if it works. 

     

    Chage the calendar file to only a date and maybe a day of week...

  • RE: Trying to join three different tables ...

    Well here goes my first post, and i've only been working wils sql server for about a month, so This is probably wrong!!!  also the example only has 2 files...

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