Solved

To clean up all of the old records in the database which have a particular URL

Posted on 2012-03-20
5
185 Views
Last Modified: 2012-03-28
Hi experts,
I need to clean up all of the old records in the database which have a particular URL - for example:
http://am.com/c/links.zx?nocache=1#cause,
Please suggest the query that I can use to do that
0
Comment
Question by:sqlcurious
  • 2
  • 2
5 Comments
 
LVL 18

Expert Comment

by:UnifiedIS
ID: 37743928
This would be the format of a delete query to delete specific records

DELETE FROM tablename
WHERE column = your url
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 37744133
give more info...
what is your table structure, give some sample data...
0
 

Author Comment

by:sqlcurious
ID: 37744244
I am not sure where it would be, it could be in stored procedures or in any columns of a table, so thats the challenge, please let me know if we have a way to figure out where it exists in the first place, thanks!
0
 
LVL 18

Accepted Solution

by:
UnifiedIS earned 500 total points
ID: 37744612
You can check stored procedures easily enough by scripting all your objects and dumping it into notepad or Word and then do some "finds".  If it is data within a table and you don't know which table or columns, it's certainly more involved.  
If you don't have too many tables/columns you can just manually query all the columns that could hold it.  SELECT * FROM table WHERE column LIKE '% your url %'

If there are too many tables/columns, you'd probably want to build a looping routine to look at all the tables.
0
 

Author Closing Comment

by:sqlcurious
ID: 37778744
thanks
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now