update and delete queries

  • I come from Access (!).  In Access we could do an update or delete query by simply adding two tables, and saying (delete these fields in this table) where (this field in that table = "whatever").  Or you could update a table this way (on the basis of values of fields in another table).

    In SQL Server I'm told that an update or delete query can only involve ONE table.

    Is there a simple way of doing what I want to do without knowing SQL inside out?  i.e. using the query design grid in Enterprise Manager?

    Thanks

     

     

  • You need to delete data in 2 different tables at the same time, or you need to delete data in tableA depending on some values of tableB?

  • the latter.

  • From the books online under Delete / operator

    USE pubs

    DELETE titleauthor

    FROM titleauthor INNER JOIN titles

    ON titleauthor.title_id = titles.title_id

    WHERE titles.title LIKE '%computers%'

  • Thank you!

  • HTH.

Viewing 6 posts - 1 through 5 (of 5 total)

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