delete help using output.deleted option

  • I AM TRYING TO DELETE CONTACT ID FROM CONTACT AND SALESHEADER TABLES USING OUTPUT.DELETED OPTION( CONTACTID IN SALESHEADER REFERS TO CONTACT TABLE). I AM NEWBIE TO SQL PLEASE HELP ME SOLVE

    CAN ANYBODY HELP ME SOLVE

    Contact table contains following columns

    - contactid,

    - firstname

    salesheader table contains following columns

    - SALESORDERID

    - CONTACTID

    - TOTALDUE

    DECLARE @DeleteOutput3 TABLE (CONID INT PRIMARY KEY CLUSTERED)

    DELETE Contact

    OUTPUT

    deleted.CONTACTID

    INTO @DeleteOutput3

    WHERE CONTACTID = 10;

    DELETE SALESHEADER FROM SalesHeader INNER JOIN

    @DeleteOutput3 d ON SalesHeader.CONTACTID=d.CONID

  • duplicate post. No replies please.

    Discussion already started here.

    @praveen: I asked you before not to yell at us. All it does is limiting the replies you might get.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • sure going forward will make sure that

    thanks

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply