You are here: Re: Update bad addresses « MsSQL Server « IT news, forums, messages
Re: Update bad addresses

Posted by Ed Murphy on 01/30/07 05:04

Chris wrote:

> Unfortunately I just have the email addresses.
>
> I know I can get the primary key for an individual record using a
> select statement like the one below.
> use maindb
> go
> select *
> from dbo.tblLead
> where email = 'bad@address.com'
>
> Is there a way to use the excel list in the place of the single bad
> address and then dump the results into a new table? Then do the
> update as described below as a separate process? If I wanted to just
> delete bad addresses where I don't have a new address and leave the
> rest of the lead information alone could I do that using an Inner join
> in my update? All references I have found to the delete statement
> talk about deleting entire rows of data and I don't want to do that.

Say you create a table (tblBadAddresses) with one column (email) and
dump the Excel data into it, then the next step is as follows:

update tblLead
set email = null
where email in (select email from tblBadAddresses)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация