January 8, 2009 at 12:23 am
If some one can help me out to correct my syntax would be great as i am reading an xml with value method
below is hte query
DECLARE @UserLFAMap_Rejected XML
SET @UserLFAMap_Rejected = ' '
--SELECT Modules.module.ID.value('.','VARCHAR(50)')as Module123
Select Module.ID.value('.','VARCHAR(20)')AS Module123 ,
Feature.ID.value('(../../Feature)[1]','VARCHAR(50)'),
Access.ID.value('(../../Access)[1]','VARCHAR(50)')
FROM @UserLFAMap_Rejected.nodes('/Modules/Module/ID') as Modules(ID)
January 8, 2009 at 2:07 am
SELECTModules.ID.value('.', 'VARCHAR(20)') AS Module123 ,
Modules.ID.value('(../../Feature)[1]', 'VARCHAR(50)') AS Feature123,
Modules.ID.value('(../../Access)[1]', 'VARCHAR(50)') AS Access123
FROM@UserLFAMap_Rejected.nodes('/Modules/Module/ID') as Modules(ID)
N 56°04'39.16"
E 12°55'05.25"
January 8, 2009 at 9:35 am
The above thing dosent work as it has 2 values for each node and i need to read all the 2 values
any luck from any 1
January 9, 2009 at 12:16 am
New requirements?
SELECTModules.ID.value('.', 'VARCHAR(20)') AS Module123,
Modules.ID.value('(../../Feature)[1]', 'VARCHAR(50)') AS Feature123a,
Modules.ID.value('(../../Feature)[2]', 'VARCHAR(50)') AS Feature123b,
Modules.ID.value('(../../Access)[1]', 'VARCHAR(50)') AS Access123a,
Modules.ID.value('(../../Access)[2]', 'VARCHAR(50)') AS Access123b
FROM@UserLFAMap_Rejected.nodes('/Modules/Module/ID') as Modules(ID)
N 56°04'39.16"
E 12°55'05.25"
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply