Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML from Query with functions in Select
Message
De
28/09/2001 04:08:23
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
XML from Query with functions in Select
Divers
Thread ID:
00561817
Message ID:
00561817
Vues:
46
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
Répondre
Fil
Voir

Click here to load this message in the networking platform