delete record

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bher2

    delete record

    please help

    i was trying to delete a specific record on a table but it still shows
    the same record that should be deleted. i dont know how.
  • Simon Hayes

    #2
    Re: delete record

    bhetong22@yahoo .com (bher2) wrote in message news:<f34a4b26. 0401272320.6f8c d318@posting.go ogle.com>...[color=blue]
    > please help
    >
    > i was trying to delete a specific record on a table but it still shows
    > the same record that should be deleted. i dont know how.[/color]

    How are you deleting it? How are you seeing it? Try something like
    this from Query Analyzer:

    delete from dbo.MyTable
    where MyPrimaryKeyCol umn = ...

    select *
    from dbo.MyTable
    where MyPrimaryKeyCol umn = ...

    Simon

    Comment

    • Chuck Conover

      #3
      Re: delete record

      bher2,
      There may be several reasons for this. Here are some ideas:
      - Do a select before you do the delete. See if that brings up the records
      you think it will bring up.
      - Try the select, then the delete in SQL Query analyzer. If you are doing
      this in an application, you might not be seeing any errors that come up,
      like foreign key errors.
      - Try grabbing the PK first for the record(s) you want to delete, if there
      is one and then delete by PK.
      - Try updating the statistics on the table. If they are "broken", your db
      might not be finding the record(s) you expect, if any.

      Hope that helps,
      Best regards,
      Chuck Conover



      "bher2" <bhetong22@yaho o.com> wrote in message
      news:f34a4b26.0 401272320.6f8cd 318@posting.goo gle.com...[color=blue]
      > please help
      >
      > i was trying to delete a specific record on a table but it still shows
      > the same record that should be deleted. i dont know how.[/color]


      Comment

      • Harold Helmich

        #4
        Re: delete record

        Also, take a look at triggers on the table. There may be a trigger
        defined as "instead of delete", which could prevent actual deletion of
        the record and just mark it as deleted.

        Chuck Conover wrote:[color=blue]
        > bher2,
        > There may be several reasons for this. Here are some ideas:
        > - Do a select before you do the delete. See if that brings up the records
        > you think it will bring up.
        > - Try the select, then the delete in SQL Query analyzer. If you are doing
        > this in an application, you might not be seeing any errors that come up,
        > like foreign key errors.
        > - Try grabbing the PK first for the record(s) you want to delete, if there
        > is one and then delete by PK.
        > - Try updating the statistics on the table. If they are "broken", your db
        > might not be finding the record(s) you expect, if any.
        >
        > Hope that helps,
        > Best regards,
        > Chuck Conover
        > www.TechnicalVideos.net
        >
        >
        > "bher2" <bhetong22@yaho o.com> wrote in message
        > news:f34a4b26.0 401272320.6f8cd 318@posting.goo gle.com...
        >[color=green]
        >>please help
        >>
        >>i was trying to delete a specific record on a table but it still shows
        >>the same record that should be deleted. i dont know how.[/color]
        >
        >
        >[/color]

        Comment

        Working...