We help IT Professionals succeed at work.
Get Started

SQL : remove table data

464 Views
Last Modified: 2014-05-13
SQL :

I have a large SQL table (called uploads) i wish to trim a lot of data out of to reduce the overall filesize which is balooning.


I am no SQL expert so any help would be greatly appreciated.

Uploaded files are saved directly into a database in a column as xml data.   The column is called 'XMLData'

I want to seach the table and remove uploaded file data from the 'xmldata' column that is older than 1 month. - this task will be run on a regular basis, am i best off using a query or a stored procedure?  I dont know whats best?

Basically this is what i want to do....

Where column 'messagetype'=AddAttachment' or 'App'

and 'datestamp' column is more than 1 month old..

remove the content data between the tags <contents> </contents>  in the  'XMLdata' column.

Thanks for any help and pointers in advance.
Comment
Watch Question
Senior DBA
CERTIFIED EXPERT
Most Valuable Expert 2018
Distinguished Expert 2019
Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE