I need help creating an SQL Script for MS SQL 2000 Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ricardoh2000
    New Member
    • Sep 2007
    • 1

    I need help creating an SQL Script for MS SQL 2000 Server

    I need to find all the email addresses that are missing the @ sign and remove them from the DB. If I run this below:

    SELECT * FROM MEMBERS_ WHERE MemberID_ = 408956
    GO

    I can see that the field called EmailAddr_ shows the data with the missing @ sign.
    I would like to run some script that returns all or any EmailAddr_ Members with the missing @ sign and then another one that will flush them out.

    Any help would be great
  • vijaii
    New Member
    • May 2007
    • 15

    #2
    Originally posted by Ricardoh2000
    I need to find all the email addresses that are missing the @ sign and remove them from the DB. If I run this below:

    SELECT * FROM MEMBERS_ WHERE MemberID_ = 408956
    GO

    I can see that the field called EmailAddr_ shows the data with the missing @ sign.
    I would like to run some script that returns all or any EmailAddr_ Members with the missing @ sign and then another one that will flush them out.

    Any help would be great
    Try this one...

    --To show all the email address with missing @ symbol
    SELECT * FROM MEMBERS_
    WHERE EmailAddr_ Members NOT LIKE '%@%'

    --To delete all the members with missing @ symbol
    DELETE FROM MEMBERS_
    WHERE EmailAddr_ Members NOT LIKE '%@%'

    Comment

    Working...