70-433 Study Tests Probable Errata (DELETE FROM FROM)

  • I got a question wrong in the practice test. I'm pretty sure this type of format is not allowed. Am I way off here, is this some obscure t-sql coding practice that I'm not aware of?

    The correct statement is DELETE FROM Products AS P1 FROM NewProducts AS P2 WHERE P1.id = P2.idThe FROM statement is used in a DELETE statement to indicate a table join.

    Or is it likely a typo?

    Thanks for the sanity check.

    Keith Wiggans

  • It's close. It should be:

    DELETE FROM Products FROM Products AS P1 JOIN NewProducts AS P2 ON P1.id = P2.id

    Note that the first FROM is optional, so it also could be:

    DELETE Products FROM Products AS P1 JOIN NewProducts AS P2 ON P1.id = P2.id

    Edit: See the DELETE statement in BOL for detailed information.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Right, there is no FROM FROM.

    Just wanted to bounce that off of somebody.

    The practice exam is full of weird little errors like that.

    Thanks 😀

    Keith Wiggans

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

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