Solved

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

Posted on 2012-03-20
5
197 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
[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
  • 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:Huseyin KAHRAMAN
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

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.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

756 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