>>>>>What am I missing?
>>>>
>>>>Have you tried running this exact command (copy and paste it in SSMS)?
>>>
>>>Yes, the result says, "1 row(s) affected". So I presume the record should have been deleted. But then I Select it and it is there. Strange.
>>
>>Are you sure you're testing in the exact same database?
>>
>>E.g. you run
>>execute 'delete ...
>> select * from myTable where PK = ...
>>
>>---------------
>>Also, do
>>
>>select @@TRANCOUNT
>>
>>just in case to see the current transaction count.
>>
>>If the row is not deleted after you ran these two commands (delete following by select), then you need to check the triggers.
>
>If you look at Borislav's code it checks all that. And still the record is not deleted. And no triggers at all in this database.
Are you sure about triggers? And also what is @@TRANCOUNT ?
Find that table in the Object Explorer and look under triggers for that table.
Also, just in case - re-start SSMS and re-try these delete commands.
If it's not broken, fix it until it is.
My Blog