Solved

Query XML in a database table

Posted on 2014-04-29
4
220 Views
Last Modified: 2014-04-29
Hi,
I need to query a column in a database containing XML, I would like to delete all rows that do not contain the word Receipt in the XML?
could someone help with this please?

Regards,
Atorex
0
Comment
Question by:atorex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 22

Expert Comment

by:plusone3055
ID: 40030181
DELETE FROM <your table>
WHERE <your column>   NOT LIKE '%receipt%'
0
 
LVL 22

Accepted Solution

by:
plusone3055 earned 500 total points
ID: 40030186
DELETE FROM <your table>
WHERE <your column>   NOT LIKE '%receipt%'
0
 

Author Closing Comment

by:atorex
ID: 40030258
thanks, I used the not like but did not use the %, knowledge is a beautiful thing!

thanks.
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 40030276
no problem have a great day
0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question