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]
|