February 24, 2004 at 7:32 am
How can i get rid of all the dead links in my table
Here's the table structure
CREATE TABLE [dbo].[tblScience] (
[Email] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Name] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Keywords] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[About] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Url] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[id] [int] IDENTITY (1, 1) NOT NULL ,
[dateadded] [smalldatetime] NOT NULL
) ON [PRIMARY]
GO
thanks Mic.
February 24, 2004 at 9:34 am
Do you mean dead URL links? You'd need a cursor to run through all the values in the table and test each link. I'd do this with VB, get a result set of the table, then check each URL using the MS Internet control and if you get a 404, then delete that row.
February 24, 2004 at 9:46 am
hi Steve,
yeap thats exactly what i mean... to get all the dead urls and then delete...
there's about 8,000 records in the table... i havent worked with vb ... i use asp and sql server.
any helps would be greatly appreciated.
thanks
Mic.
February 24, 2004 at 10:19 am
Not sure how you'd do it in ASP, bascially you need some object to go through and "test" the URL. It would be similar to consuming a web service in ASP (http://aspnet.4guysfromrolla.com/articles/062602-1.aspx), where you'd open a result set on your page with a row from the table, check the URL. If valid, then refresh your page and get the next row. You might be able to use the dateadded column to continuously get the next row (> previous dateadded, top 1).
If the URL was an error, then delete the row and refresh the page with the next row.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply