• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

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

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
sqlcurious
Asked:
sqlcurious
  • 2
  • 2
1 Solution
 
UnifiedISCommented:
This would be the format of a delete query to delete specific records

DELETE FROM tablename
WHERE column = your url
0
 
HainKurtSr. System AnalystCommented:
give more info...
what is your table structure, give some sample data...
0
 
sqlcuriousAuthor Commented:
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
 
UnifiedISCommented:
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
 
sqlcuriousAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now