Viewing 5 posts - 136 through 140 (of 140 total)
I also echo the comments being made on this thread. Unless you have good reason to split out the database, you really shouldn't be....
I had to help support/develop a commercial...
January 5, 2012 at 1:57 pm
No Problem. thanks for the feedback.
January 5, 2012 at 9:36 am
Here is a slightly revised query that should work with the example xml:
WITH XMLNAMESPACES(
'http://informationsystems/schema/messages' as s,
'http://controlsystems/schema/Events' as m,
default 'http://informationsystems/schema/messages'
)
SELECT
x.value('(TrainCycleID)[1]','int') AS TrainCycleID,
x.value('(Job)[1]','int') AS JobID,
x.value('(s:UnloadingEvent/m:Events/m:LogixEvent/m:DateAndTime)[1]','varchar(max)') AS EventDateAndTimeZulu,
x.value('(s:UnloadingEvent/m:Events/m:LogixEvent/m:UnloadingEvent/m:UnloadingOperatorAction/m:StartTrain/m:DumpStation)[1]','varchar(max)') AS Dumpstation,
x.value('(s:UnloadingEvent/m:Events/m:LogixEvent/m:UnloadingEvent/m:UnloadingOperatorAction/m:StartTrain/m:Destination)[1]','varchar(max)') AS Destination
FROM...
January 5, 2012 at 7:45 am
You can get the namespace by adding this with clause just before the query:
e.g.
with xmlnamespaces (default 'urn:reviewset-1.0')
select .....
Not sure why you are having problems with the image not coming through....
January 5, 2012 at 7:28 am
This is one way to shred the example xml into the format ready for you to insert into a table:
select c.value('../../name[1]', 'varchar(100)'),
c.value('artno[1]', 'varchar(100)'),
c.value('description[1]', 'varchar(100)'),
c.value('price[1]', 'money')
from @x.nodes('//article') t(c)
Hope this gets you...
January 5, 2012 at 7:14 am
Viewing 5 posts - 136 through 140 (of 140 total)