Results 1 to 5 of 5

Thread: delete records

  1. #1

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    delete records

    hello! How do I delete a duplicate records in sql? I have autonumber number primary key.
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  2. #2

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: delete records

    this is what i have in my table
    36918 EL20080752 CARIAGA ADRIAN PAUL R. MALE LC4 READING4 NULL St. Gemma
    36930 EL20080752 CARIAGA ADRIAN PAUL R. MALE LC4 READING4 NULL St. Gemma
    36931 EL20080753 CLAVEL ZYRIL JAY F. MALE LC4 READING4 NULL St. Gemma
    36943 EL20080753 CLAVEL ZYRIL JAY F. MALE LC4 READING4 NULL St. Gemma
    36944 EL20080754 DELA TORRE CHRISTIAN FELIX T. MALE LC4 READING4 NULL St. Gemma
    36956 EL20080754 DELA TORRE CHRISTIAN FELIX T. MALE LC4 READING4 NULL St. Gemma
    36957 EL20080755 DIAZON MARK JOSEPH M. MALE LC4 READING4 NULL St. Gemma
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  3. #3
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166

    Re: delete records

    I'd say you have two options (assuming dups are in fact identical).
    That is you could have a Dup where the name is slightly misspelled,
    upper/lower case may also play a role.

    ==============================

    1) Set up a Key for the fldName Address String.
    2) Load in the first record and seek others similiar strings.
    3) If found delete it (assume you want to keep the first occurance)
    4) Continues looping through the DB (until .EOF), repeating
    the next record, seek, etc.

    =================

    With SQL you may be able to do a Query and Group by the Name Addr field
    but then you would have to manually delete dups.
    Last edited by dw85745; Jul 25th, 2008 at 10:29 PM.

  4. #4

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: delete records

    how do i do it in sql management studio? I am using vb2005 and sql2005
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  5. #5
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: delete records


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width