July 8, 2005 at 8:39 am
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
July 8, 2005 at 8:45 am
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?
July 8, 2005 at 9:05 am
the latter.
July 8, 2005 at 9:24 am
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%'
July 9, 2005 at 1:44 am
Thank you!
July 9, 2005 at 7:18 am
HTH.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply