Viewing 15 posts - 16 through 30 (of 159 total)
SELECT
N1.x.value('(./NM1.03/NM1.03.1/text())[1]', 'NVARCHAR(256)') AS [NM1.03.1]
, N2.x.value('(./N4.01/N4.01.1/text())[1]', 'NVARCHAR(256)') AS [NM4.01.1]
, N3.x.value('(./NTE.02/NTE.02.1/text())[1]', 'NVARCHAR(256)') AS [NTE.02.1]
FROM
@x.nodes('/X12Transaction/NM1[position()= 3]') as N1(x)
, @x.nodes('/X12Transaction/N4[position()= 5]') as N2(x)
...
May 23, 2014 at 12:31 pm
Test...
onclick:if_IFCode('', 'NVARCHAR(256)') AS [NM1.03.1]
, N2.x.value('(./N4.01/N4.01.1/text())[1]', 'NVARCHAR(256)') AS [NM4.01.1]
, N3.x.value('(./NTE.02/NTE.02.1/text())[1]', 'NVARCHAR(256)') AS [NTE.02.1]
FROM
@x.nodes('/X12Transaction/NM1[position()= 3]') as N1(x)
, @x.nodes('/X12Transaction/N4[position()= 5]') as N2(x)
...
May 23, 2014 at 12:29 pm
I think I got it but want your advice if I am doing this correctly and if you would go about it the same way.
SELECT
N1.x.value('(./NM1.03/NM1.03.1/text())[1]', 'NVARCHAR(256)') AS [NM1.03.1]
,...
May 23, 2014 at 11:08 am
One other question. If I want to SELECT specific nodes / attributes, what am I doing wrong below?
DECLARE @x xml = '<X12Transaction elementDelimiter="*" segmentDelimiter=" " subelementDelimiter=">">
<ISA>
...
May 23, 2014 at 10:43 am
This is beautiful! Thank you very much. This will get me heading down the right path.
May 23, 2014 at 9:50 am
BTW - How do I put the code in a query window on SSC so its easier on the eyes?
May 23, 2014 at 8:52 am
Below are three different ways to identify what exists in TableA that does not exist in TableB. Pick your flavor.
--EXCEPT
SELECT * FROM TABLEA
EXCEPT
SELECT * FROM TABLEB
--LEFT OUTER JOIN
SELECT a.*...
April 25, 2014 at 6:31 am
Thanks everyone!
Jeff - I got some reading, coding, and testing this weekend! Thanks for the great posts.
March 20, 2014 at 7:15 pm
Never played with CROSS Tab. Do you have an example I can play around with?
I looked into books online but not sure if I'm looking at the right thing here....
March 19, 2014 at 7:44 pm
I redesigned the structure. The PIVOT function helped me out. Thanks all for your input!
March 19, 2014 at 6:40 pm
Here is the sample data. I'm only using the four columns as an example. I will be needing more once I implement. If there is a more...
March 19, 2014 at 5:54 am
Thanks guys! I will read Jeff's article and post the data structure correctly.
For the sub select solution. This may work. Is there anyway to insert the...
March 19, 2014 at 5:02 am
I cant have hard coded values. I am looking to select the columns since the values will vary as different data is inserted into this table. Any other...
March 18, 2014 at 7:16 pm
Thank you Loundy! Gail are you in agreement to shrink and rebuild indexes?
March 29, 2013 at 8:03 am
Viewing 15 posts - 16 through 30 (of 159 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy