Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML from Query with functions in Select
Message
From
28/09/2001 04:08:23
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
XML from Query with functions in Select
Miscellaneous
Thread ID:
00561817
Message ID:
00561817
Views:
45
Can someone tell me why this query doesn't return all data in XML?

Without XML this query :

    Select top 2 gop.iOpendOnID
    , dbo.fc_GetTypeCode(gop.iDayID) As cDay
    , dbo.fc_GetTypeCode(otd.iDayPartID) As cDagPart
    , otd.cHHMMFrom
    , otd.cHHMMTo
    From OpenTimes otd
    Inner Join OpenOn gop On otd.iOpenOnID = gop.iOpenOnID
    Where gop.iLocationID = @tiLocationID -- FK
    And    ( gop.iExamID = @tiExamID
            Or IsNull(@tiExamID,-1) = IsNull(gop.iExamID,-1)
            )
    Order By cDay
--    For XML Auto, Elements

returns:


iOpendOnID cDay cDayPart cHHMMVan cHHMMTot
------------ ---- -------- -------- --------
2            DI  DAYTIME    0900    1700
2            DI  EVENING    1800    2100


But with XML this query returns:

<gop>
  <iOpendOnID>2</iOpendOnID>
  <cDay>DI</cDay>
  <cDayPart>DAYTIME</cDayPart>
  <otd>
    <cHHMMFrom>0900</cHHMMFrom>
    <cHHMMTo>1700</cHHMMTo>
  </otd>
  <otd>
    <cHHMMFrom>1800</cHHMMFrom>
    <cHHMMTo>2100</cHHMMTo>
  </otd>
</gop>

So no EVENING
Reply
Map
View

Click here to load this message in the networking platform