Results 1 to 2 of 2

Thread: How to avoid deleting a database record:

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Posts
    376

    How to avoid deleting a database record:

    With the diagram shown below it is clear that I cannot delete any records for the tables connected to the center one because of foreign key constrains.

    I could however delete any records found in the main table “Listing”.

    What functions or properties can I give to this table “Listing” so NO records can ever be deleted?

    Thanks
    Attached Images Attached Images  

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: How to avoid deleting a database record:

    Is this MS SQL SERVER??

    Look into INSTEAD of TRIGGERS - and simply stop the DELETE with that.

    I don't have SQL here to play with or I would whip one up for you...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

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