User Tools

Site Tools


campus:data:query:contacts

Contacts

Delete Phone Number

This query deletes a specified phone number from all records in the contact table.

BEGIN TRANSACTION
UPDATE Contact
SET 
homePhone = CASE WHEN homePhone = '(555)555-5555' THEN NULL ELSE homePhone END,
workPhone = CASE WHEN workPhone = '(555)555-5555' THEN NULL ELSE workPhone END,
cellPhone = CASE WHEN cellPhone = '(555)555-5555' THEN NULL ELSE cellPhone END
WHERE homePhone = '(555)555-5555' OR workPhone = '(555)555-5555' OR  cellPhone = '(555)555-5555'
ROLLBACK TRANSACTION
--COMMIT TRANSACTION
campus/data/query/contacts.txt · Last modified: Sunday, August 13, 2023 12:01 AM by Nathan C. McGuire