Showing posts with label content. Show all posts
Showing posts with label content. Show all posts

Friday, March 9, 2012

How to read the content of DTS local package?

I create a local package in DTS a few months ago. And set a schedule to run daily. Now i need to modify. How to read the content of DTS local package? i try to right click the package in job, and edit, but i didn't see the content. How can i see it and modify. Why mine can't be read? Thanks.you need to go under :

Data Transformation Services ->Local Packages in Enterprise manager.

You'll see your package there.|||I can find the package, But i want to see the content. As this is a package that import some of data from another database. So i can't read the content that means the query. I forgot, but i need to modify. Thanks.|||YYU I think SQL SERVER 2005 has a utility that allows you to SEE/EDIT your DTS file, regarless of the version used to create this files.

You can also try to monitor the activty on your SQL SERVER using the PROFILER TOOL, wich comes with SQL SERVER 2000+, and run your DTS files. Your SQL QUERY should appear in your TRACE FILE.

BTW this forum ROCKS!!

BIGGGG UP!!|||Thanks. It is great to have sql server 2005. We will have later. Let's see.

Thanks again!

How to read the content of a flat file in Stored procedure

Hi there,
How to read the content of a flat file in Stored procedure into a
variable? I am also trying to find the size of a given flat file into a
variable in stored procedure.
Does anybody have any ideas on these?
Thanks in advance,
-- Sree
*** Sent via Developersdex http://www.examnotes.net ***Perhaps you can use the T-SQL command BULK INSERT. You will have to read
the data into a table.
as far as finding out the file attributes (file size) - perhaps you can use
xp_cmdshell to give you the "dos" level information.
Keith Kratochvil
"sasachi sachi sachi" <sasachi@.getmail.com> wrote in message
news:OYLTC%23UbGHA.404@.TK2MSFTNGP04.phx.gbl...
> Hi there,
> How to read the content of a flat file in Stored procedure into a
> variable? I am also trying to find the size of a given flat file into a
> variable in stored procedure.
> Does anybody have any ideas on these?
> Thanks in advance,
> -- Sree
> *** Sent via Developersdex http://www.examnotes.net ***|||to get the file size use this
declare @.FileName VARCHAR(149)
SELECT @.FileName ='C:\Program Files\Microsoft SQL
Server\MSSQL\readme.txt'
EXEC master..xp_getfiledetails @.FileName
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||EXEC master..xp_getfiledetails @.file
"Keith Kratochvil" wrote:

> Perhaps you can use the T-SQL command BULK INSERT. You will have to read
> the data into a table.
> as far as finding out the file attributes (file size) - perhaps you can us
e
> xp_cmdshell to give you the "dos" level information.
> --
> Keith Kratochvil
>
> "sasachi sachi sachi" <sasachi@.getmail.com> wrote in message
> news:OYLTC%23UbGHA.404@.TK2MSFTNGP04.phx.gbl...
>
>|||Also, yu can access that using xp_cmdshell.
SET @.cmd='DIR '+@.outputfolder
EXEC @.res=master..xp_cmdshell @.cmd
"sasachi sachi sachi"?? ??? ??:

> Hi there,
> How to read the content of a flat file in Stored procedure into a
> variable? I am also trying to find the size of a given flat file into a
> variable in stored procedure.
> Does anybody have any ideas on these?
> Thanks in advance,
> -- Sree
> *** Sent via Developersdex http://www.examnotes.net ***
>

Wednesday, March 7, 2012

How to read contents of text file from t-sql ?

Hi friends,
I need to read content of text file and store them in
string variable in my store procedure, Is there t-sql or
function to read content of text file ?
Thanks.There is no direct set of functions to do it, but you could use the sp_OA*
set of procedures to access the file. For an example of how to use these
procedures see:
http://www32.brinkster.com/srisamp/sqlArticles/article_32.htm
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"Kresna Rudy Kurniawan" <kresna_rk@.yahoo.com> wrote in message
news:081001c3a377$c35948b0$a601280a@.phx.gbl...
> Hi friends,
> I need to read content of text file and store them in
> string variable in my store procedure, Is there t-sql or
> function to read content of text file ?
>
> Thanks.

How to read a XML file from a stored procedure?

From a stored procedure, I would like to import into a varchar variable the
content of a
XML file before I invoke the sp_xml_preparedocument SP. If possible, I want
to avoid to
first have to import the XML file into a table.
Is it possible at all with SQL 2000 SP4 to directly import a XML file? How?
thanks.It seems XQuery is one way as I'm starting to read this article [1]
<%= Clinton Gallagher
[1] http://www.idealliance.org/proceedi.../XQueryRDS.html
"Gaetan" <me@.somewhere.com> wrote in message
news:4eqd129irfvdj5fem8v118jt9d6qd2gibm@.
4ax.com...
> From a stored procedure, I would like to import into a varchar variable
> the content of a
> XML file before I invoke the sp_xml_preparedocument SP. If possible, I
> want to avoid to
> first have to import the XML file into a table.
> Is it possible at all with SQL 2000 SP4 to directly import a XML file?
> How?
> thanks.|||XQuery could have been an avenue to explore had not been for the fact that I
'm stuck with
SQL 2000 SP4 for a while longer.
On Tue, 14 Mar 2006 10:26:15 -0600, "clintonG"
< csgallagher@.REMOVETHISTEXTmetromilwaukee
.com> wrote:

>It seems XQuery is one way as I'm starting to read this article [1]
><%= Clinton Gallagher
>[1] http://www.idealliance.org/proceedi.../XQueryRDS.html
>|||You would have to write an extended stored procedure that reads the data
from a file. SQL Server 2005 has native ability to read from a file but not
SQL Server 2000.
My recommendation is to read the file in the client code and pass it to the
database as a stored procedure parameter...
Best regards
Michael
"Gaetan" <me@.somewhere.com> wrote in message
news:4eqd129irfvdj5fem8v118jt9d6qd2gibm@.
4ax.com...
> From a stored procedure, I would like to import into a varchar variable
> the content of a
> XML file before I invoke the sp_xml_preparedocument SP. If possible, I
> want to avoid to
> first have to import the XML file into a table.
> Is it possible at all with SQL 2000 SP4 to directly import a XML file?
> How?
> thanks.|||we are haveing a similar issue attempting to read xml through our own
firewall, (we can only have sql port and port 80 available) so no fileopen
methods are available:
so we cant use vbnet:readxml method as the filepath violates firewall
security: it is becoming a showstopper for our solution . if we could
paramaterise a sp passing in the filename problem would be solved.
All we have found so far is a declare @.doc; exec @.doc = cmdShell
and execute a dos "type" command to type out the contents into the variable.
There are several examples of this method on the net.
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> wrote in message
news:uoqgZ$uTGHA.1708@.TK2MSFTNGP14.phx.gbl...
> You would have to write an extended stored procedure that reads the data
> from a file. SQL Server 2005 has native ability to read from a file but
> not SQL Server 2000.
> My recommendation is to read the file in the client code and pass it to
> the database as a stored procedure parameter...
> Best regards
> Michael
> "Gaetan" <me@.somewhere.com> wrote in message
> news:4eqd129irfvdj5fem8v118jt9d6qd2gibm@.
4ax.com...
>

How to read a XML file from a stored procedure?

From a stored procedure, I would like to import into a varchar variable the content of a
XML file before I invoke the sp_xml_preparedocument SP. If possible, I want to avoid to
first have to import the XML file into a table.
Is it possible at all with SQL 2000 SP4 to directly import a XML file? How?
thanks.
It seems XQuery is one way as I'm starting to read this article [1]
<%= Clinton Gallagher
[1] http://www.idealliance.org/proceedin...XQueryRDS.html
"Gaetan" <me@.somewhere.com> wrote in message
news:4eqd129irfvdj5fem8v118jt9d6qd2gibm@.4ax.com...
> From a stored procedure, I would like to import into a varchar variable
> the content of a
> XML file before I invoke the sp_xml_preparedocument SP. If possible, I
> want to avoid to
> first have to import the XML file into a table.
> Is it possible at all with SQL 2000 SP4 to directly import a XML file?
> How?
> thanks.
|||XQuery could have been an avenue to explore had not been for the fact that I'm stuck with
SQL 2000 SP4 for a while longer.
On Tue, 14 Mar 2006 10:26:15 -0600, "clintonG"
<csgallagher@.REMOVETHISTEXTmetromilwaukee.com> wrote:

>It seems XQuery is one way as I'm starting to read this article [1]
><%= Clinton Gallagher
>[1] http://www.idealliance.org/proceedin...XQueryRDS.html
>
|||You would have to write an extended stored procedure that reads the data
from a file. SQL Server 2005 has native ability to read from a file but not
SQL Server 2000.
My recommendation is to read the file in the client code and pass it to the
database as a stored procedure parameter...
Best regards
Michael
"Gaetan" <me@.somewhere.com> wrote in message
news:4eqd129irfvdj5fem8v118jt9d6qd2gibm@.4ax.com...
> From a stored procedure, I would like to import into a varchar variable
> the content of a
> XML file before I invoke the sp_xml_preparedocument SP. If possible, I
> want to avoid to
> first have to import the XML file into a table.
> Is it possible at all with SQL 2000 SP4 to directly import a XML file?
> How?
> thanks.

Friday, February 24, 2012

How to query XML

This is the content of one of the rows of the Message column.
<ERINOT VersionMajor="1" VersionMinor="1"
xmlns:mstns="http://tempuri.org/Dataset1.xsd">
<MessageId>
<SenderId>900013581</SenderId>
<ReceiverId>900013574</ReceiverId>
<GenerationDateTime>2005-09-15T05:54:01</GenerationDateTime>
<MessageType>PAS</MessageType>
<MessageNo>22412022</MessageNo>
<MessageFunction>9</MessageFunction>
</MessageId>
</ERINOT>
How can I query let's say the MessageType?
I tried this:
SET ARITHABORT ON
SELECT ID, Message.value('(/ERINOT/MessageId/@.MessageType)[0]',
'varchar(40)') as MType
FROM ERINOT
But this does not work
Any suggestion is higly appreciated,
Erik
E!k Visser wrote:
> This is the content of one of the rows of the Message column.
> <ERINOT VersionMajor="1" VersionMinor="1"
> xmlns:mstns="http://tempuri.org/Dataset1.xsd">
> <MessageId>
> <SenderId>900013581</SenderId>
> <ReceiverId>900013574</ReceiverId>
> <GenerationDateTime>2005-09-15T05:54:01</GenerationDateTime>
> <MessageType>PAS</MessageType>
> <MessageNo>22412022</MessageNo>
> <MessageFunction>9</MessageFunction>
> </MessageId>
> </ERINOT>
> How can I query let's say the MessageType?
> I tried this:
> SET ARITHABORT ON
> SELECT ID, Message.value('(/ERINOT/MessageId/@.MessageType)[0]',
> 'varchar(40)') as MType
> FROM ERINOT
@.MessageType selects an attribute while you have a MessageType element.
Furthermore with XPath/XQuery the first node has index 1 not 0 so use
(/ERINOT/MessageId/MessageType)[1]

Martin Honnen -- MVP XML
http://JavaScript.FAQTs.com/
|||Or if your XML is not constrained by a schema, the following is more
efficient by directly accessing the text node:
(/ERINOT/MessageId/MessageType/text())[1]
Best regards
Michael
"Martin Honnen" <mahotrash@.yahoo.de> wrote in message
news:ObjdJ2osHHA.2164@.TK2MSFTNGP02.phx.gbl...
> E!k Visser wrote:
> @.MessageType selects an attribute while you have a MessageType element.
> Furthermore with XPath/XQuery the first node has index 1 not 0 so use
> (/ERINOT/MessageId/MessageType)[1]
>
> --
> Martin Honnen -- MVP XML
> http://JavaScript.FAQTs.com/
|||Michael,
Thanks for your contribution, but I do not understand what would be the
difference.
What would the query look like in you scenario?
Perhaps good to know I might be limited by the fact I have to use ADO to
access the database.
Erik
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> schreef in bericht
news:uexsXRpsHHA.412@.TK2MSFTNGP04.phx.gbl...
> Or if your XML is not constrained by a schema, the following is more
> efficient by directly accessing the text node:
> (/ERINOT/MessageId/MessageType/text())[1]
> Best regards
> Michael
> "Martin Honnen" <mahotrash@.yahoo.de> wrote in message
> news:ObjdJ2osHHA.2164@.TK2MSFTNGP02.phx.gbl...
>
|||Martin,
"Martin Honnen" <mahotrash@.yahoo.de> schreef in bericht
news:ObjdJ2osHHA.2164@.TK2MSFTNGP02.phx.gbl...
> E!k Visser wrote:
> @.MessageType selects an attribute while you have a MessageType element.
> Furthermore with XPath/XQuery the first node has index 1 not 0 so use
> (/ERINOT/MessageId/MessageType)[1]
Thank you very much! This works like a charm.
But no I have another question, how can I list all nodes?
This could be the XML:
<ContainerMatrixes>
<ContainerMatrix>
<ContRange>RNG20</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
<ContainerMatrix>
<ContRange>RNG30</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
<ContainerMatrix>
<ContRange>RNG40</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
</ContainerMatrixes>
And now I Like to query the ContRange and have three rows as result. It
should be as generic as possible, as in this case a ship usually carries
more than three containers...
Any suggestions?
Erik
|||E!k Visser wrote:

> But no I have another question, how can I list all nodes?
> This could be the XML:
> <ContainerMatrixes>
> <ContainerMatrix>
> <ContRange>RNG20</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> <ContainerMatrix>
> <ContRange>RNG30</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> <ContainerMatrix>
> <ContRange>RNG40</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> </ContainerMatrixes>
> And now I Like to query the ContRange and have three rows as result.
Here is an example, use the nodes method to shred the XML into rows,
then use one of the methods query or value to extract values.
DECLARE @.x XML;
SET @.x = ' <ContainerMatrixes>
<ContainerMatrix>
<ContRange>RNG20</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
<ContainerMatrix>
<ContRange>RNG30</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
<ContainerMatrix>
<ContRange>RNG40</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
</ContainerMatrixes>';
SELECT T.ContRange.query('.')
FROM @.x.nodes('ContainerMatrixes/ContainerMatrix/ContRange') AS
T(ContRange);
Result is
<ContRange>RNG20</ContRange>
<ContRange>RNG30</ContRange>
<ContRange>RNG40</ContRange>

Martin Honnen -- MVP XML
http://JavaScript.FAQTs.com/
|||Martin,

> Here is an example, use the nodes method to shred the XML into rows, then
> use one of the methods query or value to extract values.
> DECLARE @.x XML;
> SET @.x = ' <ContainerMatrixes>
> <ContainerMatrix>
> <ContRange>RNG20</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> <ContainerMatrix>
> <ContRange>RNG30</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> <ContainerMatrix>
> <ContRange>RNG40</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> </ContainerMatrixes>';
> SELECT T.ContRange.query('.')
> FROM @.x.nodes('ContainerMatrixes/ContainerMatrix/ContRange') AS
> T(ContRange);
> Result is
> <ContRange>RNG20</ContRange>
> <ContRange>RNG30</ContRange>
> <ContRange>RNG40</ContRange>
Thanks for this, it is very helpfull. Studying the BOL I found the way to
use this with a table as well.
For the moment it leaves me with (another) question:
How can I tranform the XML result I get with this towards the value?
TIA,
Erik
|||Found, thanks anyway.
">> Result is
> Thanks for this, it is very helpfull. Studying the BOL I found the way to
> use this with a table as well.
> For the moment it leaves me with (another) question:
> How can I tranform the XML result I get with this towards the value?
> TIA,
> Erik
|||The query below would look like:
SELECT ID, Message.value('(/ERINOT/MessageId/@.MessageType/text())[1]',
'varchar(40)') as MType
FROM ERINOT
Best regards
Michael
"E!k Visser" <burod004@.planet.nl> wrote in message
news:5dqj01F33sav3U1@.mid.individual.net...
> Michael,
> Thanks for your contribution, but I do not understand what would be the
> difference.
> What would the query look like in you scenario?
> Perhaps good to know I might be limited by the fact I have to use ADO to
> access the database.
> Erik
> "Michael Rys [MSFT]" <mrys@.online.microsoft.com> schreef in bericht
> news:uexsXRpsHHA.412@.TK2MSFTNGP04.phx.gbl...
>
|||Thanks!
Had to like twice but now I see the difference.
regards,
Erik
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> schreef in bericht
news:%23IejCQEtHHA.3400@.TK2MSFTNGP03.phx.gbl...
> The query below would look like:
> SELECT ID, Message.value('(/ERINOT/MessageId/@.MessageType/text())[1]',
> 'varchar(40)') as MType
> FROM ERINOT
> Best regards
> Michael
> "E!k Visser" <burod004@.planet.nl> wrote in message
> news:5dqj01F33sav3U1@.mid.individual.net...
>

How to query XML

This is the content of one of the rows of the Message column.
<ERINOT VersionMajor="1" VersionMinor="1"
xmlns:mstns="http://tempuri.org/Dataset1.xsd">
<MessageId>
<SenderId>900013581</SenderId>
<ReceiverId>900013574</ReceiverId>
<GenerationDateTime>2005-09-15T05:54:01</GenerationDateTime>
<MessageType>PAS</MessageType>
<MessageNo>22412022</MessageNo>
<MessageFunction>9</MessageFunction>
</MessageId>
</ERINOT>
How can I query let's say the MessageType?
I tried this:
SET ARITHABORT ON
SELECT ID, Message.value('(/ERINOT/MessageId/@.MessageType)[0]',
'varchar(40)') as MType
FROM ERINOT
But this does not work
Any suggestion is higly appreciated,
ErikE!k Visser wrote:
> This is the content of one of the rows of the Message column.
> <ERINOT VersionMajor="1" VersionMinor="1"
> xmlns:mstns="http://tempuri.org/Dataset1.xsd">
> <MessageId>
> <SenderId>900013581</SenderId>
> <ReceiverId>900013574</ReceiverId>
> <GenerationDateTime>2005-09-15T05:54:01</GenerationDateTime>
> <MessageType>PAS</MessageType>
> <MessageNo>22412022</MessageNo>
> <MessageFunction>9</MessageFunction>
> </MessageId>
> </ERINOT>
> How can I query let's say the MessageType?
> I tried this:
> SET ARITHABORT ON
> SELECT ID, Message.value('(/ERINOT/MessageId/@.MessageType)[0]',
> 'varchar(40)') as MType
> FROM ERINOT
@.MessageType selects an attribute while you have a MessageType element.
Furthermore with XPath/XQuery the first node has index 1 not 0 so use
(/ERINOT/MessageId/MessageType)[1]
Martin Honnen -- MVP XML
http://JavaScript.FAQTs.com/|||Or if your XML is not constrained by a schema, the following is more
efficient by directly accessing the text node:
(/ERINOT/MessageId/MessageType/text())[1]
Best regards
Michael
"Martin Honnen" <mahotrash@.yahoo.de> wrote in message
news:ObjdJ2osHHA.2164@.TK2MSFTNGP02.phx.gbl...
> E!k Visser wrote:
> @.MessageType selects an attribute while you have a MessageType element.
> Furthermore with XPath/XQuery the first node has index 1 not 0 so use
> (/ERINOT/MessageId/MessageType)[1]
>
> --
> Martin Honnen -- MVP XML
> http://JavaScript.FAQTs.com/|||Michael,
Thanks for your contribution, but I do not understand what would be the
difference.
What would the query look like in you scenario?
Perhaps good to know I might be limited by the fact I have to use ADO to
access the database.
Erik
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> schreef in bericht
news:uexsXRpsHHA.412@.TK2MSFTNGP04.phx.gbl...
> Or if your XML is not constrained by a schema, the following is more
> efficient by directly accessing the text node:
> (/ERINOT/MessageId/MessageType/text())[1]
> Best regards
> Michael
> "Martin Honnen" <mahotrash@.yahoo.de> wrote in message
> news:ObjdJ2osHHA.2164@.TK2MSFTNGP02.phx.gbl...
>|||Martin,
"Martin Honnen" <mahotrash@.yahoo.de> schreef in bericht
news:ObjdJ2osHHA.2164@.TK2MSFTNGP02.phx.gbl...
> E!k Visser wrote:
> @.MessageType selects an attribute while you have a MessageType element.
> Furthermore with XPath/XQuery the first node has index 1 not 0 so use
> (/ERINOT/MessageId/MessageType)[1]
Thank you very much! This works like a charm.
But no I have another question, how can I list all nodes?
This could be the XML:
<ContainerMatrixes>
<ContainerMatrix>
<ContRange>RNG20</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
<ContainerMatrix>
<ContRange>RNG30</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
<ContainerMatrix>
<ContRange>RNG40</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
</ContainerMatrixes>
And now I Like to query the ContRange and have three rows as result. It
should be as generic as possible, as in this case a ship usually carries
more than three containers...
Any suggestions?
Erik|||E!k Visser wrote:

> But no I have another question, how can I list all nodes?
> This could be the XML:
> <ContainerMatrixes>
> <ContainerMatrix>
> <ContRange>RNG20</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> <ContainerMatrix>
> <ContRange>RNG30</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> <ContainerMatrix>
> <ContRange>RNG40</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> </ContainerMatrixes>
> And now I Like to query the ContRange and have three rows as result.
Here is an example, use the nodes method to shred the XML into rows,
then use one of the methods query or value to extract values.
DECLARE @.x XML;
SET @.x = ' <ContainerMatrixes>
<ContainerMatrix>
<ContRange>RNG20</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
<ContainerMatrix>
<ContRange>RNG30</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
<ContainerMatrix>
<ContRange>RNG40</ContRange>
<Number>0</Number>
<ContStatus>6</ContStatus>
</ContainerMatrix>
</ContainerMatrixes>';
SELECT T.ContRange.query('.')
FROM @.x.nodes('ContainerMatrixes/ContainerMatrix/ContRange') AS
T(ContRange);
Result is
<ContRange>RNG20</ContRange>
<ContRange>RNG30</ContRange>
<ContRange>RNG40</ContRange>
Martin Honnen -- MVP XML
http://JavaScript.FAQTs.com/|||Martin,

> Here is an example, use the nodes method to shred the XML into rows, then
> use one of the methods query or value to extract values.
> DECLARE @.x XML;
> SET @.x = ' <ContainerMatrixes>
> <ContainerMatrix>
> <ContRange>RNG20</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> <ContainerMatrix>
> <ContRange>RNG30</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> <ContainerMatrix>
> <ContRange>RNG40</ContRange>
> <Number>0</Number>
> <ContStatus>6</ContStatus>
> </ContainerMatrix>
> </ContainerMatrixes>';
> SELECT T.ContRange.query('.')
> FROM @.x.nodes('ContainerMatrixes/ContainerMatrix/ContRange') AS
> T(ContRange);
> Result is
> <ContRange>RNG20</ContRange>
> <ContRange>RNG30</ContRange>
> <ContRange>RNG40</ContRange>
Thanks for this, it is very helpfull. Studying the BOL I found the way to
use this with a table as well.
For the moment it leaves me with (another) question:
How can I tranform the XML result I get with this towards the value?
TIA,
Erik|||Found, thanks anyway.
">> Result is
> Thanks for this, it is very helpfull. Studying the BOL I found the way to
> use this with a table as well.
> For the moment it leaves me with (another) question:
> How can I tranform the XML result I get with this towards the value?
> TIA,
> Erik|||The query below would look like:
SELECT ID, Message.value('(/ERINOT/MessageId/@.MessageType/text())[1]',
'varchar(40)') as MType
FROM ERINOT
Best regards
Michael
"E!k Visser" <burod004@.planet.nl> wrote in message
news:5dqj01F33sav3U1@.mid.individual.net...
> Michael,
> Thanks for your contribution, but I do not understand what would be the
> difference.
> What would the query look like in you scenario?
> Perhaps good to know I might be limited by the fact I have to use ADO to
> access the database.
> Erik
> "Michael Rys [MSFT]" <mrys@.online.microsoft.com> schreef in bericht
> news:uexsXRpsHHA.412@.TK2MSFTNGP04.phx.gbl...
>|||Thanks!
Had to like twice but now I see the difference.
regards,
Erik
"Michael Rys [MSFT]" <mrys@.online.microsoft.com> schreef in bericht
news:%23IejCQEtHHA.3400@.TK2MSFTNGP03.phx.gbl...
> The query below would look like:
> SELECT ID, Message.value('(/ERINOT/MessageId/@.MessageType/text())[1]',
> 'varchar(40)') as MType
> FROM ERINOT
> Best regards
> Michael
> "E!k Visser" <burod004@.planet.nl> wrote in message
> news:5dqj01F33sav3U1@.mid.individual.net...
>