var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Delete Records when you have a primary key of two Columns
I have two tables: the catalog table and the detail table.
The two tables are joined by a two-columns key.
I want to make a Delete sentence for delete all the rows in the Catalog table that aren't in the detail table, in SQL Server.
The only problem is that the key is composed by two colums.
If the Key was maded of one column, that would be easy, like this:
DELETE FROM CATALOG
WHERE CATALOGKEY NOT IN (SELECT CATALOGKEY FROM DETAIL)
But it is possible to make a delete sentence if the key has two columns ?
But of course
Originally Posted by fnajar
WHERE NOT EXISTS
WHERE DETAIL.CATALOGKEY = CATALOG.CATALOGKEY
AND DETAIL.FIELD2= CATALOG.FIELD2)
ur codings are working excelent.
I get a sense that something else is afoot...
Read the sticky at the top of the forum and post what it asks for